diff --git a/.docker/Dockerfile.storage b/.docker/Dockerfile.storage index dd9ff2684..dc37d9569 100644 --- a/.docker/Dockerfile.storage +++ b/.docker/Dockerfile.storage @@ -6,6 +6,8 @@ WORKDIR /src COPY . /src RUN make bin/frostfs-node +RUN make bin/frostfs-cli +RUN make bin/frostfs-adm # Executable image FROM alpine AS frostfs-node @@ -14,5 +16,7 @@ RUN apk add --no-cache bash WORKDIR / COPY --from=builder /src/bin/frostfs-node /bin/frostfs-node +COPY --from=builder /src/bin/frostfs-cli /bin/frostfs-cli +COPY --from=builder /src/bin/frostfs-adm /bin/frostfs-adm CMD ["frostfs-node"] diff --git a/cmd/frostfs-adm/internal/modules/morph/balance.go b/cmd/frostfs-adm/internal/modules/morph/balance.go index 6debc50b9..75bd66854 100644 --- a/cmd/frostfs-adm/internal/modules/morph/balance.go +++ b/cmd/frostfs-adm/internal/modules/morph/balance.go @@ -114,7 +114,7 @@ func printStorageNodeBalances(cmd *cobra.Command, inv *invoker.Invoker, nmHash u if err != nil { return errors.New("can't parse the list of storage nodes") } - var ni netmap.NodeInfo + ni := netmap.NewNodeInfo() if err := ni.Unmarshal(bs); err != nil { return fmt.Errorf("can't parse the list of storage nodes: %w", err) } diff --git a/cmd/frostfs-cli/internal/client/client.go b/cmd/frostfs-cli/internal/client/client.go index babc0ef38..a01f4a248 100644 --- a/cmd/frostfs-cli/internal/client/client.go +++ b/cmd/frostfs-cli/internal/client/client.go @@ -13,6 +13,7 @@ import ( cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" @@ -118,7 +119,7 @@ type GetContainerRes struct { } // Container returns structured of the requested container. -func (x GetContainerRes) Container() containerSDK.Container { +func (x GetContainerRes) Container() *containerSDK.Container { return x.cliRes.Container() } @@ -369,7 +370,7 @@ func (x *PutObjectPrm) PrepareLocally() { } func (x *PutObjectPrm) convertToSDKPrm(ctx context.Context) (client.PrmObjectPutInit, error) { - var putPrm client.PrmObjectPutInit + putPrm := client.NewPrmObjectPutInit() if !x.prepareLocally && x.sessionToken != nil { putPrm.WithinSession(*x.sessionToken) } @@ -502,7 +503,7 @@ func (x DeleteObjectRes) Tombstone() oid.ID { // // Returns any error which prevented the operation from completing correctly in error return. func DeleteObject(ctx context.Context, prm DeleteObjectPrm) (*DeleteObjectRes, error) { - var delPrm client.PrmObjectDelete + delPrm := client.NewPrmObjectDelete() delPrm.FromContainer(prm.objAddr.Container()) delPrm.ByID(prm.objAddr.Object()) @@ -558,7 +559,7 @@ func (x GetObjectRes) Header() *objectSDK.Object { // Returns any error which prevented the operation from completing correctly in error return. // For raw reading, returns *object.SplitInfoError error if object is virtual. func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) { - var getPrm client.PrmObjectGet + getPrm := client.NewPrmObjectGet() getPrm.FromContainer(prm.objAddr.Container()) getPrm.ByID(prm.objAddr.Object()) @@ -585,14 +586,14 @@ func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) { return nil, fmt.Errorf("init object reading on client: %w", err) } - var hdr objectSDK.Object + hdr := object.New() - if !rdr.ReadHeader(&hdr) { + if !rdr.ReadHeader(hdr) { _, err = rdr.Close() return nil, fmt.Errorf("read object header: %w", err) } if prm.headerCallback != nil { - prm.headerCallback(&hdr) + prm.headerCallback(hdr) } _, err = io.Copy(prm.wrt, rdr) @@ -601,7 +602,7 @@ func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) { } return &GetObjectRes{ - hdr: &hdr, + hdr: hdr, }, nil } @@ -634,7 +635,7 @@ func (x HeadObjectRes) Header() *objectSDK.Object { // Returns any error which prevented the operation from completing correctly in error return. // For raw reading, returns *object.SplitInfoError error if object is virtual. func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error) { - var cliPrm client.PrmObjectHead + cliPrm := client.NewPrmObjectHead() cliPrm.FromContainer(prm.objAddr.Container()) cliPrm.ByID(prm.objAddr.Object()) @@ -661,14 +662,14 @@ func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error) return nil, fmt.Errorf("read object header via client: %w", err) } - var hdr objectSDK.Object + hdr := object.New() - if !res.ReadHeader(&hdr) { + if !res.ReadHeader(hdr) { return nil, fmt.Errorf("missing header in response") } return &HeadObjectRes{ - hdr: &hdr, + hdr: hdr, }, nil } @@ -699,7 +700,7 @@ func (x SearchObjectsRes) IDList() []oid.ID { // // Returns any error which prevented the operation from completing correctly in error return. func SearchObjects(ctx context.Context, prm SearchObjectsPrm) (*SearchObjectsRes, error) { - var cliPrm client.PrmObjectSearch + cliPrm := client.NewPrmObjectSearch() cliPrm.InContainer(prm.cnrID) cliPrm.SetFilters(prm.filters) @@ -789,7 +790,7 @@ func (x HashPayloadRangesRes) HashList() [][]byte { // Returns any error which prevented the operation from completing correctly in error return. // Returns an error if number of received hashes differs with the number of requested ranges. func HashPayloadRanges(ctx context.Context, prm HashPayloadRangesPrm) (*HashPayloadRangesRes, error) { - var cliPrm client.PrmObjectHash + cliPrm := client.NewPrmObjectHash() cliPrm.FromContainer(prm.objAddr.Container()) cliPrm.ByID(prm.objAddr.Object()) @@ -857,7 +858,7 @@ type PayloadRangeRes struct{} // Returns any error which prevented the operation from completing correctly in error return. // For raw reading, returns *object.SplitInfoError error if object is virtual. func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, error) { - var cliPrm client.PrmObjectRange + cliPrm := client.NewPrmObjectRange() cliPrm.FromContainer(prm.objAddr.Container()) cliPrm.ByID(prm.objAddr.Object()) @@ -921,7 +922,7 @@ func SyncContainerSettings(ctx context.Context, prm SyncContainerPrm) (*SyncCont panic("sync container settings with the network: nil container") } - err := client.SyncContainerWithNetwork(ctx, prm.c, prm.cli) + err := client.SyncContainerWithNetwork(ctx, *prm.c, prm.cli) if err != nil { return nil, err } diff --git a/cmd/frostfs-cli/internal/common/token.go b/cmd/frostfs-cli/internal/common/token.go index 102a2d59e..7e93067b2 100644 --- a/cmd/frostfs-cli/internal/common/token.go +++ b/cmd/frostfs-cli/internal/common/token.go @@ -22,7 +22,7 @@ func ReadBearerToken(cmd *cobra.Command, flagname string) *bearer.Token { PrintVerbose(cmd, "Reading bearer token from file [%s]...", path) - var tok bearer.Token + tok := bearer.NewToken() err = ReadBinaryOrJSON(cmd, &tok, path) commonCmd.ExitOnErr(cmd, "invalid bearer token: %v", err) diff --git a/cmd/frostfs-cli/modules/bearer/create.go b/cmd/frostfs-cli/modules/bearer/create.go index 2f1623d9b..924265d07 100644 --- a/cmd/frostfs-cli/modules/bearer/create.go +++ b/cmd/frostfs-cli/modules/bearer/create.go @@ -95,7 +95,7 @@ func createToken(cmd *cobra.Command, _ []string) { var ownerID user.ID commonCmd.ExitOnErr(cmd, "can't parse recipient: %w", ownerID.DecodeString(ownerStr)) - var b bearer.Token + b := bearer.NewToken() b.SetExp(exp) b.SetNbf(nvb) b.SetIat(iat) @@ -107,7 +107,7 @@ func createToken(cmd *cobra.Command, _ []string) { raw, err := os.ReadFile(eaclPath) commonCmd.ExitOnErr(cmd, "can't read extended ACL file: %w", err) commonCmd.ExitOnErr(cmd, "can't parse extended ACL: %w", json.Unmarshal(raw, table)) - b.SetEACLTable(*table) + b.SetEACLTable(table) } var data []byte diff --git a/cmd/frostfs-cli/modules/container/create.go b/cmd/frostfs-cli/modules/container/create.go index e5bbeacd4..7776be81f 100644 --- a/cmd/frostfs-cli/modules/container/create.go +++ b/cmd/frostfs-cli/modules/container/create.go @@ -7,7 +7,7 @@ import ( "strings" "time" - containerApi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + containerApi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" @@ -68,10 +68,10 @@ It will be stored in sidechain when inner ring will accepts it.`, } } - var cnr container.Container + cnr := container.NewContainer() cnr.Init() - err = parseAttributes(&cnr, containerAttributes) + err = parseAttributes(cnr, containerAttributes) commonCmd.ExitOnErr(cmd, "", err) var basicACL acl.Basic @@ -189,7 +189,7 @@ func parseContainerPolicy(cmd *cobra.Command, policyString string) (*netmap.Plac return nil, errors.New("can't parse placement policy") } -func parseAttributes(dst *container.Container, attributes []string) error { +func parseAttributes(dst container.Container, attributes []string) error { for i := range attributes { k, v, found := strings.Cut(attributes[i], attributeDelimiter) if !found { diff --git a/cmd/frostfs-cli/modules/container/get.go b/cmd/frostfs-cli/modules/container/get.go index 90bcc190a..2ff137889 100644 --- a/cmd/frostfs-cli/modules/container/get.go +++ b/cmd/frostfs-cli/modules/container/get.go @@ -76,7 +76,7 @@ func (x *stringWriter) WriteString(s string) (n int, err error) { func prettyPrintContainer(cmd *cobra.Command, cnr container.Container, jsonEncoding bool) { if jsonEncoding { - common.PrettyPrintJSON(cmd, cnr, "container") + common.PrettyPrintJSON(cmd, &cnr, "container") return } @@ -134,7 +134,7 @@ func prettyPrintBasicACL(cmd *cobra.Command, basicACL acl.Basic) { } func getContainer(cmd *cobra.Command) (container.Container, *ecdsa.PrivateKey) { - var cnr container.Container + cnr := container.NewContainer() var pk *ecdsa.PrivateKey if containerPathFrom != "" { data, err := os.ReadFile(containerPathFrom) @@ -154,7 +154,7 @@ func getContainer(cmd *cobra.Command) (container.Container, *ecdsa.PrivateKey) { res, err := internalclient.GetContainer(cmd.Context(), prm) commonCmd.ExitOnErr(cmd, "rpc error: %w", err) - cnr = res.Container() + cnr = *res.Container() } return cnr, pk } diff --git a/cmd/frostfs-cli/modules/container/list.go b/cmd/frostfs-cli/modules/container/list.go index 189cc05c7..49f5dd16c 100644 --- a/cmd/frostfs-cli/modules/container/list.go +++ b/cmd/frostfs-cli/modules/container/list.go @@ -3,7 +3,7 @@ package container import ( "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + containerapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key" @@ -70,16 +70,15 @@ var listContainersCmd = &cobra.Command{ } cnr := res.Container() - if cnrName := containerSDK.Name(cnr); flagVarListName != "" && cnrName != flagVarListName { + if cnrName := containerSDK.Name(*cnr); flagVarListName != "" && cnrName != flagVarListName { continue } cmd.Println(cnrID.String()) if flagVarListPrintAttr { cnr.IterateAttributes(func(key, val string) { - if !strings.HasPrefix(key, container.SysAttributePrefix) && !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { - // FIXME(@cthulhu-rider): https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/97 - // Use dedicated method to skip system attributes. + if !strings.HasPrefix(key, containerapi.SysAttributePrefix) && !strings.HasPrefix(key, containerapi.SysAttributePrefixNeoFS) { + // FIXME(@cthulhu-rider): neofs-sdk-go#314 use dedicated method to skip system attributes cmd.Printf(" %s: %s\n", key, val) } }) diff --git a/cmd/frostfs-cli/modules/container/list_objects.go b/cmd/frostfs-cli/modules/container/list_objects.go index 1e0aeb4db..f399126d2 100644 --- a/cmd/frostfs-cli/modules/container/list_objects.go +++ b/cmd/frostfs-cli/modules/container/list_objects.go @@ -69,11 +69,11 @@ var listContainerObjectsCmd = &cobra.Command{ if err == nil { attrs := resHead.Header().Attributes() for i := range attrs { - attrKey := attrs[i].Key() + attrKey := attrs[i].GetKey() if !strings.HasPrefix(attrKey, v2object.SysAttributePrefix) && !strings.HasPrefix(attrKey, v2object.SysAttributePrefixNeoFS) { // FIXME(@cthulhu-rider): https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/97 // Use dedicated method to skip system attributes. - cmd.Printf(" %s: %s\n", attrKey, attrs[i].Value()) + cmd.Printf(" %s: %s\n", attrKey, attrs[i].GetValue()) } } } else { diff --git a/cmd/frostfs-cli/modules/container/set_eacl.go b/cmd/frostfs-cli/modules/container/set_eacl.go index c88d5767b..7b8943862 100644 --- a/cmd/frostfs-cli/modules/container/set_eacl.go +++ b/cmd/frostfs-cli/modules/container/set_eacl.go @@ -50,7 +50,7 @@ Container ID in EACL table will be substituted with ID from the CLI.`, var setEACLPrm internalclient.SetEACLPrm setEACLPrm.SetClient(cli) - setEACLPrm.SetTable(*eaclTable) + setEACLPrm.SetTable(eaclTable) if tok != nil { setEACLPrm.WithinSession(*tok) diff --git a/cmd/frostfs-cli/modules/container/util.go b/cmd/frostfs-cli/modules/container/util.go index 48265f785..97ccaed88 100644 --- a/cmd/frostfs-cli/modules/container/util.go +++ b/cmd/frostfs-cli/modules/container/util.go @@ -47,7 +47,7 @@ func getSession(cmd *cobra.Command) *session.Container { common.PrintVerbose(cmd, "Reading container session from the file [%s]...", path) - var res session.Container + res := session.NewContainer() err := common.ReadBinaryOrJSON(cmd, &res, path) commonCmd.ExitOnErr(cmd, "read container session: %v", err) diff --git a/cmd/frostfs-cli/modules/control/util.go b/cmd/frostfs-cli/modules/control/util.go index 5ad675c0e..3f7411fc0 100644 --- a/cmd/frostfs-cli/modules/control/util.go +++ b/cmd/frostfs-cli/modules/control/util.go @@ -4,7 +4,7 @@ import ( "crypto/ecdsa" "errors" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common" @@ -40,14 +40,14 @@ func verifyResponse(cmd *cobra.Command, commonCmd.ExitOnErr(cmd, "", errors.New("missing response signature")) } - // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion - var sigV2 refs.Signature - sigV2.SetScheme(refs.ECDSA_SHA512) + // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + var sigV2 refsapi.Signature + sigV2.SetScheme(refsapi.SignatureScheme_ECDSA_SHA512) sigV2.SetKey(sigControl.GetKey()) sigV2.SetSign(sigControl.GetSign()) - var sig frostfscrypto.Signature - commonCmd.ExitOnErr(cmd, "can't read signature: %w", sig.ReadFromV2(sigV2)) + sig := frostfscrypto.NewSignature() + commonCmd.ExitOnErr(cmd, "can't read signature: %w", sig.ReadFromV2(&sigV2)) if !sig.Verify(body.StableMarshal(nil)) { commonCmd.ExitOnErr(cmd, "", errors.New("invalid response signature")) diff --git a/cmd/frostfs-cli/modules/netmap/nodeinfo.go b/cmd/frostfs-cli/modules/netmap/nodeinfo.go index 3b2113efb..b46ec7831 100644 --- a/cmd/frostfs-cli/modules/netmap/nodeinfo.go +++ b/cmd/frostfs-cli/modules/netmap/nodeinfo.go @@ -41,7 +41,7 @@ func initNodeInfoCmd() { func prettyPrintNodeInfo(cmd *cobra.Command, i netmap.NodeInfo) { isJSON, _ := cmd.Flags().GetBool(nodeInfoJSONFlag) if isJSON { - common.PrettyPrintJSON(cmd, i, "node info") + common.PrettyPrintJSON(cmd, &i, "node info") return } @@ -61,7 +61,7 @@ func prettyPrintNodeInfo(cmd *cobra.Command, i netmap.NodeInfo) { cmd.Println("state:", stateWord) - netmap.IterateNetworkEndpoints(i, func(s string) { + netmap.IterateNetworkEndpoints(&i, func(s string) { cmd.Println("address:", s) }) diff --git a/cmd/frostfs-cli/modules/object/hash.go b/cmd/frostfs-cli/modules/object/hash.go index 26243e7e7..301b2c79a 100644 --- a/cmd/frostfs-cli/modules/object/hash.go +++ b/cmd/frostfs-cli/modules/object/hash.go @@ -78,7 +78,7 @@ func getObjectHash(cmd *cobra.Command, _ []string) { res, err := internalclient.HeadObject(cmd.Context(), headPrm) commonCmd.ExitOnErr(cmd, "rpc error: %w", err) - var cs checksum.Checksum + cs := checksum.NewChecksum() var csSet bool if tz { diff --git a/cmd/frostfs-cli/modules/object/head.go b/cmd/frostfs-cli/modules/object/head.go index db466e588..42811488e 100644 --- a/cmd/frostfs-cli/modules/object/head.go +++ b/cmd/frostfs-cli/modules/object/head.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" @@ -150,21 +150,21 @@ func printHeader(cmd *cobra.Command, obj *objectSDK.Object) error { cmd.Println("Attributes:") for _, attr := range obj.Attributes() { - if attr.Key() == objectSDK.AttributeTimestamp { + if attr.GetKey() == objectSDK.AttributeTimestamp { cmd.Printf(" %s=%s (%s)\n", - attr.Key(), - attr.Value(), - common.PrettyPrintUnixTime(attr.Value())) + attr.GetKey(), + attr.GetValue(), + common.PrettyPrintUnixTime(attr.GetValue())) continue } - cmd.Printf(" %s=%s\n", attr.Key(), attr.Value()) + cmd.Printf(" %s=%s\n", attr.GetKey(), attr.GetValue()) } if signature := obj.Signature(); signature != nil { cmd.Print("ID signature:\n") - // TODO(@carpawell): #468 implement and use another approach to avoid conversion - var sigV2 refs.Signature + // TODO(@carpawell): #1387 implement and use another approach to avoid conversion + var sigV2 refsapi.Signature signature.WriteToV2(&sigV2) cmd.Printf(" public key: %s\n", hex.EncodeToString(sigV2.GetKey())) diff --git a/cmd/frostfs-cli/modules/object/lock.go b/cmd/frostfs-cli/modules/object/lock.go index fa1898586..b4162003b 100644 --- a/cmd/frostfs-cli/modules/object/lock.go +++ b/cmd/frostfs-cli/modules/object/lock.go @@ -65,7 +65,7 @@ var objectLockCmd = &cobra.Command{ var idOwner user.ID user.IDFromKey(&idOwner, key.PublicKey) - var lock objectSDK.Lock + lock := objectSDK.NewLock() lock.WriteMembers(lockList) exp, _ := cmd.Flags().GetUint64(commonflags.ExpireAt) @@ -88,7 +88,7 @@ var objectLockCmd = &cobra.Command{ common.PrintVerbose(cmd, "Lock object will expire after %d epoch", exp) - var expirationAttr objectSDK.Attribute + expirationAttr := *objectSDK.NewAttribute() expirationAttr.SetKey(objectV2.SysAttributeExpEpoch) expirationAttr.SetValue(strconv.FormatUint(exp, 10)) diff --git a/cmd/frostfs-cli/modules/object/put.go b/cmd/frostfs-cli/modules/object/put.go index 97bb12dbc..99e8a9b99 100644 --- a/cmd/frostfs-cli/modules/object/put.go +++ b/cmd/frostfs-cli/modules/object/put.go @@ -16,6 +16,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key" commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" "github.com/cheggaaa/pb" @@ -196,7 +197,7 @@ func getAllObjectAttributes(cmd *cobra.Command) []objectSDK.Attribute { expAttrValue := strconv.FormatUint(expiresOn, 10) for i := range attrs { - if attrs[i].Key() == objectV2.SysAttributeExpEpoch { + if attrs[i].GetKey() == objectV2.SysAttributeExpEpoch { attrs[i].SetValue(expAttrValue) expAttrFound = true break @@ -205,7 +206,7 @@ func getAllObjectAttributes(cmd *cobra.Command) []objectSDK.Attribute { if !expAttrFound { index := len(attrs) - attrs = append(attrs, objectSDK.Attribute{}) + attrs = append(attrs, *objectSDK.NewAttribute()) attrs[index].SetKey(objectV2.SysAttributeExpEpoch) attrs[index].SetValue(expAttrValue) } @@ -227,6 +228,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]objectSDK.Attribute, error) { if !found { return nil, fmt.Errorf("invalid attribute format: %s", rawAttrs[i]) } + attrs[i] = *object.NewAttribute() attrs[i].SetKey(k) attrs[i].SetValue(v) } @@ -235,7 +237,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]objectSDK.Attribute, error) { if !disableFilename { filename := filepath.Base(cmd.Flag(fileFlag).Value.String()) index := len(attrs) - attrs = append(attrs, objectSDK.Attribute{}) + attrs = append(attrs, *objectSDK.NewAttribute()) attrs[index].SetKey(objectSDK.AttributeFileName) attrs[index].SetValue(filename) } @@ -243,7 +245,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]objectSDK.Attribute, error) { disableTime, _ := cmd.Flags().GetBool("disable-timestamp") if !disableTime { index := len(attrs) - attrs = append(attrs, objectSDK.Attribute{}) + attrs = append(attrs, *objectSDK.NewAttribute()) attrs[index].SetKey(objectSDK.AttributeTimestamp) attrs[index].SetValue(strconv.FormatInt(time.Now().Unix(), 10)) } diff --git a/cmd/frostfs-lens/internal/blobovnicza/inspect.go b/cmd/frostfs-lens/internal/blobovnicza/inspect.go index b1a6e3fd2..0da91c9a6 100644 --- a/cmd/frostfs-lens/internal/blobovnicza/inspect.go +++ b/cmd/frostfs-lens/internal/blobovnicza/inspect.go @@ -38,7 +38,7 @@ func inspectFunc(cmd *cobra.Command, _ []string) { data := res.Object() - var o objectSDK.Object + o := *objectSDK.New() common.ExitOnErr(cmd, common.Errf("could not unmarshal object: %w", o.Unmarshal(data)), ) diff --git a/cmd/frostfs-lens/internal/printers.go b/cmd/frostfs-lens/internal/printers.go index dd73a5552..4a8de758a 100644 --- a/cmd/frostfs-lens/internal/printers.go +++ b/cmd/frostfs-lens/internal/printers.go @@ -21,7 +21,7 @@ func PrintObjectHeader(cmd *cobra.Command, h objectSDK.Object) { cmd.Println("PayloadSize:", h.PayloadSize()) cmd.Println("Attributes:") for _, attr := range h.Attributes() { - cmd.Printf(" %s: %s\n", attr.Key(), attr.Value()) + cmd.Printf(" %s: %s\n", attr.GetKey(), attr.GetValue()) } } diff --git a/cmd/frostfs-lens/internal/writecache/inspect.go b/cmd/frostfs-lens/internal/writecache/inspect.go index 7d3c8ab22..4b489f3c2 100644 --- a/cmd/frostfs-lens/internal/writecache/inspect.go +++ b/cmd/frostfs-lens/internal/writecache/inspect.go @@ -27,7 +27,7 @@ func inspectFunc(cmd *cobra.Command, _ []string) { data, err := writecache.Get(db, []byte(vAddress)) common.ExitOnErr(cmd, common.Errf("could not fetch object: %w", err)) - var o objectSDK.Object + o := *objectSDK.New() common.ExitOnErr(cmd, common.Errf("could not unmarshal object: %w", o.Unmarshal(data))) common.PrintObjectHeader(cmd, o) diff --git a/cmd/frostfs-node/cache.go b/cmd/frostfs-node/cache.go index bae38b299..00980810a 100644 --- a/cmd/frostfs-node/cache.go +++ b/cmd/frostfs-node/cache.go @@ -208,7 +208,7 @@ func newCachedContainerStorage(v container.Source, ttl time.Duration) ttlContain } func (s ttlContainerStorage) handleRemoval(cnr cid.ID) { - s.set(cnr, nil, apistatus.ContainerNotFound{}) + s.set(cnr, nil, apistatus.NewContainerNotFound()) } // Get returns container value from the cache. If value is missing in the cache diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 5d7adab29..1753caf97 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -15,7 +15,7 @@ import ( "syscall" "time" - netmapV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + netmapV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config" apiclientconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/apiclient" contractsconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/contracts" @@ -423,7 +423,7 @@ type cfg struct { // latest epoch. Returns an error if value has not been cached yet. // // Provides interface for NetmapService server. -func (c *cfg) ReadCurrentNetMap(msg *netmapV2.NetMap) error { +func (c *cfg) ReadCurrentNetMap(msg *netmapV2.Netmap) error { val := c.netMap.Load() if val == nil { return errors.New("missing local network map") @@ -563,6 +563,8 @@ func initCfg(appCfg *config.Config) *cfg { } c.cfgContainer = initContainer(appCfg) + c.cfgNodeInfo = initCfgNodeInfo() + c.cfgNetmap = initNetmap(appCfg, netState, relayOnly) c.cfgGRPC = initCfgGRPC() @@ -654,6 +656,12 @@ func initContainer(appCfg *config.Config) cfgContainer { } } +func initCfgNodeInfo() cfgNodeInfo { + return cfgNodeInfo{ + localInfo: netmap.NewNodeInfo(), + } +} + func initCfgGRPC() cfgGRPC { maxChunkSize := uint64(maxMsgSize) * 3 / 4 // 25% to meta, 75% to payload maxAddrAmount := uint64(maxChunkSize) / addressSize // each address is about 72 bytes diff --git a/cmd/frostfs-node/container.go b/cmd/frostfs-node/container.go index 9a6cfd02b..c429b7004 100644 --- a/cmd/frostfs-node/container.go +++ b/cmd/frostfs-node/container.go @@ -9,7 +9,6 @@ import ( "fmt" "strconv" - containerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" @@ -470,7 +469,7 @@ func (d *localStorageLoad) Iterate(f loadcontroller.UsedSpaceFilter, h loadcontr zap.Stringer("cid", idList[i]), ) - var a containerSDK.SizeEstimation + a := *containerSDK.NewSizeEstimation() a.SetContainer(idList[i]) a.SetValue(sz) @@ -534,10 +533,10 @@ func (c *usedSpaceService) ExternalAddresses() []string { return c.cfg.ExternalAddresses() } -func (c *usedSpaceService) AnnounceUsedSpace(ctx context.Context, req *containerV2.AnnounceUsedSpaceRequest) (*containerV2.AnnounceUsedSpaceResponse, error) { +func (c *usedSpaceService) AnnounceUsedSpace(ctx context.Context, req *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) { var passedRoute []loadcontroller.ServerInfo - for hdr := req.GetVerificationHeader(); hdr != nil; hdr = hdr.GetOrigin() { + for hdr := req.GetVerifyHeader(); hdr != nil; hdr = hdr.GetOrigin() { passedRoute = append(passedRoute, &containerOnlyKeyRemoteServerInfo{ key: hdr.GetBodySignature().GetKey(), }) @@ -554,7 +553,7 @@ func (c *usedSpaceService) AnnounceUsedSpace(ctx context.Context, req *container return nil, fmt.Errorf("could not initialize container's used space writer: %w", err) } - var est containerSDK.SizeEstimation + est := *containerSDK.NewSizeEstimation() for _, aV2 := range req.GetBody().GetAnnouncements() { err = est.ReadFromV2(aV2) @@ -567,9 +566,9 @@ func (c *usedSpaceService) AnnounceUsedSpace(ctx context.Context, req *container } } - respBody := new(containerV2.AnnounceUsedSpaceResponseBody) + respBody := new(containerGRPC.AnnounceUsedSpaceResponse_Body) - resp := new(containerV2.AnnounceUsedSpaceResponse) + resp := new(containerGRPC.AnnounceUsedSpaceResponse) resp.SetBody(respBody) c.cfg.respSvc.SetMeta(resp) diff --git a/cmd/frostfs-node/frostfs-node b/cmd/frostfs-node/frostfs-node new file mode 100755 index 000000000..c190dba87 Binary files /dev/null and b/cmd/frostfs-node/frostfs-node differ diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index b7b09a00b..d58e078c8 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -445,7 +445,7 @@ func (n *netInfo) Dump(ver version.Version) (*netmapSDK.NetworkInfo, error) { return nil, err } - var ni netmapSDK.NetworkInfo + ni := netmapSDK.NewNetworkInfo() ni.SetCurrentEpoch(n.netState.CurrentEpoch()) ni.SetMagicNumber(magic) @@ -454,7 +454,7 @@ func (n *netInfo) Dump(ver version.Version) (*netmapSDK.NetworkInfo, error) { return nil, fmt.Errorf("read network configuration using netmap contract client: %w", err) } - if mjr := ver.Major(); mjr > 2 || mjr == 2 && ver.Minor() > 9 { + if mjr := ver.GetMajor(); mjr > 2 || mjr == 2 && ver.GetMinor() > 9 { msPerBlock, err := n.msPerBlockRdr() if err != nil { return nil, fmt.Errorf("ms per block: %w", err) diff --git a/cmd/frostfs-node/object.go b/cmd/frostfs-node/object.go index 1d99d958b..c7c0fc710 100644 --- a/cmd/frostfs-node/object.go +++ b/cmd/frostfs-node/object.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" metricsconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/metrics" policerconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/policer" @@ -70,31 +69,31 @@ func (s *objectSvc) Put() (objectService.PutObjectStream, error) { return s.put.Put() } -func (s *objectSvc) PutSingle(ctx context.Context, req *object.PutSingleRequest) (*object.PutSingleResponse, error) { +func (s *objectSvc) PutSingle(ctx context.Context, req *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { return s.put.PutSingle(ctx, req) } -func (s *objectSvc) Head(ctx context.Context, req *object.HeadRequest) (*object.HeadResponse, error) { +func (s *objectSvc) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { return s.get.Head(ctx, req) } -func (s *objectSvc) Search(req *object.SearchRequest, stream objectService.SearchStream) error { +func (s *objectSvc) Search(req *objectGRPC.SearchRequest, stream objectService.SearchStream) error { return s.search.Search(req, stream) } -func (s *objectSvc) Get(req *object.GetRequest, stream objectService.GetObjectStream) error { +func (s *objectSvc) Get(req *objectGRPC.GetRequest, stream objectService.GetObjectStream) error { return s.get.Get(req, stream) } -func (s *objectSvc) Delete(ctx context.Context, req *object.DeleteRequest) (*object.DeleteResponse, error) { +func (s *objectSvc) Delete(ctx context.Context, req *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) { return s.delete.Delete(ctx, req) } -func (s *objectSvc) GetRange(req *object.GetRangeRequest, stream objectService.GetObjectRangeStream) error { +func (s *objectSvc) GetRange(req *objectGRPC.GetRangeRequest, stream objectService.GetObjectRangeStream) error { return s.get.GetRange(req, stream) } -func (s *objectSvc) GetRangeHash(ctx context.Context, req *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error) { +func (s *objectSvc) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) { return s.get.GetRangeHash(ctx, req) } diff --git a/cmd/frostfs-node/session.go b/cmd/frostfs-node/session.go index f9c1811a1..828828c5d 100644 --- a/cmd/frostfs-node/session.go +++ b/cmd/frostfs-node/session.go @@ -5,7 +5,6 @@ import ( "fmt" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" nodeconfig "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/node" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event" @@ -19,7 +18,7 @@ import ( ) type sessionStorage interface { - Create(ctx context.Context, body *session.CreateRequestBody) (*session.CreateResponseBody, error) + Create(ctx context.Context, body *sessionGRPC.CreateRequest_Body) (*sessionGRPC.CreateResponse_Body, error) Get(ownerID user.ID, tokenID []byte) *storage.PrivateToken RemoveOld(epoch uint64) diff --git a/cmd/internal/common/exit.go b/cmd/internal/common/exit.go index 9e4fa3098..f2bf0f582 100644 --- a/cmd/internal/common/exit.go +++ b/cmd/internal/common/exit.go @@ -31,8 +31,8 @@ func ExitOnErr(cmd *cobra.Command, errFmt string, err error) { var ( code int - internalErr = new(sdkstatus.ServerInternal) - accessErr = new(sdkstatus.ObjectAccessDenied) + internalErr = sdkstatus.NewServerInternal() + accessErr = sdkstatus.NewObjectAccessDenied() ) switch { diff --git a/cmd/internal/common/netmap.go b/cmd/internal/common/netmap.go index 94964e0d2..91288f44d 100644 --- a/cmd/internal/common/netmap.go +++ b/cmd/internal/common/netmap.go @@ -26,7 +26,7 @@ func PrettyPrintNodeInfo(cmd *cobra.Command, node netmap.NodeInfo, cmd.Printf("%sNode %d: %s %s ", indent, index+1, hex.EncodeToString(node.PublicKey()), strState) - netmap.IterateNetworkEndpoints(node, func(endpoint string) { + netmap.IterateNetworkEndpoints(&node, func(endpoint string) { cmd.Printf("%s ", endpoint) }) cmd.Println() diff --git a/go.mod b/go.mod index 9a53bb8fa..42e9ec2b1 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,11 @@ module git.frostfs.info/TrueCloudLab/frostfs-node go 1.19 +replace ( + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230704092742-285516a94ebe => git.frostfs.info/aarifullin/frostfs-api-go/v2 v2.15.1-0.20230710090848-bc16a32c24c3 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230706140617-98cab7ed6166 => git.frostfs.info/aarifullin/frostfs-sdk-go v0.0.0-20230712160837-6281a25556ae +) + require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230704092742-285516a94ebe git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a diff --git a/go.mod.docker b/go.mod.docker new file mode 100644 index 000000000..13b97bd87 --- /dev/null +++ b/go.mod.docker @@ -0,0 +1,129 @@ +module git.frostfs.info/TrueCloudLab/frostfs-node + +go 1.19 + +replace ( + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230602142716-68021b910acb => ./frostfs-api-go + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230628121302-5d62cef27e6c => ./frostfs-sdk-go +) + +require ( + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230602142716-68021b910acb + git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a + git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230628121302-5d62cef27e6c + git.frostfs.info/TrueCloudLab/hrw v1.2.1 + git.frostfs.info/TrueCloudLab/tzhash v1.8.0 + github.com/cheggaaa/pb v1.0.29 + github.com/chzyer/readline v1.5.1 + github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 + github.com/google/uuid v1.3.0 + github.com/hashicorp/golang-lru/v2 v2.0.4 + github.com/klauspost/compress v1.16.6 + github.com/mitchellh/go-homedir v1.1.0 + github.com/mr-tron/base58 v1.2.0 + github.com/multiformats/go-multiaddr v0.9.0 + github.com/nats-io/nats.go v1.27.1 + github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc + github.com/olekukonko/tablewriter v0.0.5 + github.com/panjf2000/ants/v2 v2.7.5 + github.com/paulmach/orb v0.9.2 + github.com/prometheus/client_golang v1.16.0 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 + go.etcd.io/bbolt v1.3.7 + go.opentelemetry.io/otel v1.16.0 + go.opentelemetry.io/otel/trace v1.16.0 + go.uber.org/zap v1.24.0 + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df + golang.org/x/sync v0.3.0 + golang.org/x/term v0.9.0 + google.golang.org/grpc v1.56.1 + google.golang.org/protobuf v1.31.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect + git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/benbjohnson/clock v1.3.5 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.11.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0-rc.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.5 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect + github.com/hashicorp/golang-lru v0.6.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/holiman/uint256 v1.2.2 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/ipfs/go-cid v0.4.1 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect + github.com/multiformats/go-multihash v0.2.3 // indirect + github.com/multiformats/go-varint v0.0.7 // indirect + github.com/nats-io/nats-server/v2 v2.7.4 // indirect + github.com/nats-io/nkeys v0.4.4 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 // indirect + github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce // indirect + github.com/nspcc-dev/rfc6979 v0.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect + github.com/twmb/murmur3 v1.1.8 // indirect + github.com/urfave/cli v1.22.14 // indirect + go.mongodb.org/mongo-driver v1.12.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/sdk v1.16.0 // indirect + go.opentelemetry.io/proto/otlp v0.20.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect + google.golang.org/genproto v0.0.0-20230628200519-e449d1ea0e82 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230628200519-e449d1ea0e82 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230628200519-e449d1ea0e82 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + lukechampine.com/blake3 v1.2.1 // indirect + rsc.io/tmplfunc v0.0.3 // indirect +) diff --git a/go.mod.sum b/go.mod.sum new file mode 100644 index 000000000..03bc6e46c --- /dev/null +++ b/go.mod.sum @@ -0,0 +1,1008 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a h1:EeaOunifY30ATPzOo1F32vUDW299UXDHYukZrIVxBZ0= +git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= +git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= +git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= +git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 h1:aGQ6QaAnTerQ5Dq5b2/f9DUQtSqPkZZ/bkMx/HKuLCo= +git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6/go.mod h1:W8Nn08/l6aQ7UlIbpF7FsQou7TVpcRD1ZT1KG4TrFhE= +git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230628121302-5d62cef27e6c h1:nH9mifyAuiZeyc79DDwNZjbJeomz0YW4Ja6Mk/iuaLI= +git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230628121302-5d62cef27e6c/go.mod h1:w+s3ozlbFfTDFHhjX0A3Iif3BRtnTkwiACxFZD+Q0cQ= +git.frostfs.info/TrueCloudLab/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc= +git.frostfs.info/TrueCloudLab/hrw v1.2.1/go.mod h1:C1Ygde2n843yTZEQ0FP69jYiuaYV0kriLvP4zm8JuvM= +git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= +git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= +git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjqZzS4gsb4UA= +git.frostfs.info/TrueCloudLab/tzhash v1.8.0/go.mod h1:dhY+oy274hV8wGvGL4MwwMpdL3GYvaX1a8GQZQHvlF8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/CityOfZion/neo-go v0.62.1-pre.0.20191114145240-e740fbe708f8/go.mod h1:MJCkWUBhi9pn/CrYO1Q3P687y2KeahrOPS9BD9LDGb0= +github.com/CityOfZion/neo-go v0.70.1-pre.0.20191209120015-fccb0085941e/go.mod h1:0enZl0az8xA6PVkwzEOwPWVJGqlt/GO4hA4kmQ5Xzig= +github.com/CityOfZion/neo-go v0.70.1-pre.0.20191212173117-32ac01130d4c/go.mod h1:JtlHfeqLywZLswKIKFnAp+yzezY4Dji9qlfQKB2OD/I= +github.com/CityOfZion/neo-go v0.71.1-pre.0.20200129171427-f773ec69fb84/go.mod h1:FLI526IrRWHmcsO+mHsCbj64pJZhwQFTLJZu+A4PGOA= +github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/abiosoft/ishell v2.0.0+incompatible/go.mod h1:HQR9AqF2R3P4XXpMpI0NAzgHf/aS6+zVXRj14cVk9qg= +github.com/abiosoft/ishell/v2 v2.0.2/go.mod h1:E4oTCXfo6QjoCart0QYa5m9w4S+deXs/P/9jA77A9Bs= +github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db/go.mod h1:rB3B4rKii8V21ydCbIzH5hZiCQE7f5E9SzUb/ZZx530= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521073959-f0d4d129b7f1/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= +github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.11.0 h1:QqzHQlwEqlQr5jfWblGDkwlKHpT+4QodYqqExkAtyks= +github.com/consensys/gnark-crypto v0.11.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BMXYYRWTLOJKlh+lOBt6nUQgXAfB7oVIQt5cNreqSLI= +github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:rZfgFAXFS/z/lEd6LJmf9HVZ1LkgYiHx5pHhV5DR16M= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-redis/redis v6.10.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0-rc.0 h1:mdLirNAJBxnGgyB6pjZLcs6ue/6eZGBui6gXspfq4ks= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0-rc.0/go.mod h1:kdXbOySqcQeTxiqglW7aahTmWZy3Pgi6SYL36yvKeyA= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.5 h1:3IZOAnD058zZllQTZNBioTlrzrBG/IjpiZ133IEtusM= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.5/go.mod h1:xbKERva94Pw2cPen0s79J3uXmGzbbpDYFBFDlZ4mV/w= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= +github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.4 h1:7GHuZcgid37q8o5i3QI9KMT4nCWQQ3Kx3Ov6bb9MfK0= +github.com/hashicorp/golang-lru/v2 v2.0.4/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= +github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= +github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= +github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= +github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multiaddr v0.9.0 h1:3h4V1LHIk5w4hJHekMKWALPXErDfz/sggzwC/NcqbDQ= +github.com/multiformats/go-multiaddr v0.9.0/go.mod h1:mI67Lb1EeTOYb8GQfL/7wpIZwc46ElrvzhYnoJOmTT0= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= +github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLLeY23zRWJ9Zktr5jp+mloR942LEOpY= +github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= +github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= +github.com/nats-io/nats.go v1.27.1 h1:OuYnal9aKVSnOzLQIzf7554OXMCG7KbaTkCSBHRcSoo= +github.com/nats-io/nats.go v1.27.1/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= +github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nspcc-dev/dbft v0.0.0-20191205084618-dacb1a30c254/go.mod h1:w1Ln2aT+dBlPhLnuZhBV+DfPEdS2CHWWLp5JTScY3bw= +github.com/nspcc-dev/dbft v0.0.0-20191209120240-0d6b7568d9ae/go.mod h1:3FjXOoHmA51EGfb5GS/HOv7VdmngNRTssSeQ729dvGY= +github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a/go.mod h1:/YFK+XOxxg0Bfm6P92lY5eDSLYfp06XOdL8KAVgXjVk= +github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62prQSqizzoagHmuuKoz8QMkU3SzBoKdEvm3aQ= +github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y= +github.com/nspcc-dev/dbft v0.0.0-20220902113116-58a5e763e647/go.mod h1:g9xisXmX9NP9MjioaTe862n9SlZTrP+6PVUWLBYOr98= +github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= +github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22 h1:n4ZaFCKt1pQJd7PXoMJabZWK9ejjbLOVrkl/lOUmshg= +github.com/nspcc-dev/go-ordered-json v0.0.0-20220111165707-25110be27d22/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U= +github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU= +github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= +github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM= +github.com/nspcc-dev/neo-go v0.99.4/go.mod h1:mKTolfRUfKjFso5HPvGSQtUZc70n0VKBMs16eGuC5gA= +github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc h1:fySIWvUQsitK5e5qYIHnTDCXuPpwzz89SEUEIyY11sg= +github.com/nspcc-dev/neo-go v0.101.2-0.20230601131642-a0117042e8fc/go.mod h1:s9QhjMC784MWqTURovMbyYduIJc86mnCruxcMiAebpc= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220927123257-24c107e3a262/go.mod h1:23bBw0v6pBYcrWs8CBEEDIEDJNbcFoIh8pGGcf2Vv8s= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce h1:vLGuUNDkmQrWMa4rr4vTd1u8ULqejWxVmNz1L7ocTEI= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20230615193820-9185820289ce/go.mod h1:ZUuXOkdtHZgaC13za/zMgXfQFncZ0jLzfQTe+OsDOtg= +github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= +github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= +github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= +github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= +github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= +github.com/nspcc-dev/neofs-crypto v0.4.0/go.mod h1:6XJ8kbXgOfevbI2WMruOtI+qUJXNwSGM/E9eClXxPHs= +github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201182451-a5b61c4f6477/go.mod h1:dfMtQWmBHYpl9Dez23TGtIUKiFvCIxUZq/CkSIhEpz4= +github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659/go.mod h1:/jay1lr3w7NQd/VDBkEhkJmDmyPNsu4W+QV2obsUV40= +github.com/nspcc-dev/rfc6979 v0.1.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= +github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE= +github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/panjf2000/ants/v2 v2.7.5 h1:/vhh0Hza9G1vP1PdCj9hl6MUzCRbmtcTJL0OsnmytuU= +github.com/panjf2000/ants/v2 v2.7.5/go.mod h1:KIBmYG9QQX5U2qzFP/yQJaq/nSb6rahS9iEHkrCMgM8= +github.com/paulmach/orb v0.9.2 h1:p/YWV2uJwamAynnDOJGNbPBVtDHj3vG51k9tR1rFwJE= +github.com/paulmach/orb v0.9.2/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU= +github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= +github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/syndtr/goleveldb v0.0.0-20180307113352-169b1b37be73/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs= +github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= +github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= +github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= +github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74 h1:JwtAtbp7r/7QSyGz8mKUbYJBg2+6Cd7OjM8o/GNOcVo= +github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74/go.mod h1:RmMWU37GKR2s6pgrIEB4ixgpVCt/cf7dnJv3fuH1J1c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +github.com/yuin/gopher-lua v0.0.0-20191128022950-c6266f4fe8d7/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= +go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE= +go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 h1:t4ZwRPU+emrcvM2e9DHd0Fsf0JTPVcbfa/BhTDF03d0= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0/go.mod h1:vLarbg68dH2Wa77g71zmKQqlQ8+8Rq3GRG31uc0WcWI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 h1:cbsD4cUcviQGXdw8+bo5x2wazq10SKz8hEbtCRPcU78= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0/go.mod h1:JgXSGah17croqhJfhByOLVY719k1emAXC8MVhCIJlRs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 h1:TVQp/bboR4mhZSav+MdgXB8FaRho1RC8UwVn3T0vjVc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0/go.mod h1:I33vtIe0sR96wfrUcilIzLoA3mLHhRmz9S9Te0S3gDo= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 h1:+XWJd3jf75RXJq29mxbuXhCXFDG3S3R4vBUeSI2P7tE= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0/go.mod h1:hqgzBPTf4yONMFgdZvL/bK42R/iinTyVQtiWihs3SZc= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.20.0 h1:BLOA1cZBAGSbRiNuGCCKiFrCdYB7deeHDeD1SueyOfA= +go.opentelemetry.io/proto/otlp v0.20.0/go.mod h1:3QgjzPALBIv9pcknj2EXGPXjYPFdUh/RQfF8Lz3+Vnw= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/tools v0.0.0-20180318012157-96caea41033d/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20230628200519-e449d1ea0e82 h1:Wdfp5Hc1bqGCWYZNrir4A1Jb+SmVaV2j1DL/pbMMTGI= +google.golang.org/genproto v0.0.0-20230628200519-e449d1ea0e82/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230628200519-e449d1ea0e82 h1:iI5Fmsfz4zDINYxJLxn2YChI//ypkHM/KuVSvlN7ZXk= +google.golang.org/genproto/googleapis/api v0.0.0-20230628200519-e449d1ea0e82/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230628200519-e449d1ea0e82 h1:6b+zGQBiXFlAMpQr+cCarAdrZD4QgXSG7uUZadYysgg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230628200519-e449d1ea0e82/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/abiosoft/ishell.v2 v2.0.0/go.mod h1:sFp+cGtH6o4s1FtpVPTMcHq2yue+c4DGOVohJCPUzwY= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= +lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/go.sum b/go.sum index 31a4cb9e1..1744143e2 100644 --- a/go.sum +++ b/go.sum @@ -36,22 +36,22 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230704092742-285516a94ebe h1:SB102RiEg+4h9qcwyG97zHBtwduMRbedbtkwRDVSps8= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230704092742-285516a94ebe/go.mod h1:pKJJRLOChW4zDQsAt1e8k/snWKljJtpkiPfxV53ngjI= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a h1:EeaOunifY30ATPzOo1F32vUDW299UXDHYukZrIVxBZ0= git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a/go.mod h1:nkR5gaGeez3Zv2SE7aceP0YwxG2FzIB5cGKpQO2vV2o= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 h1:aGQ6QaAnTerQ5Dq5b2/f9DUQtSqPkZZ/bkMx/HKuLCo= git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6/go.mod h1:W8Nn08/l6aQ7UlIbpF7FsQou7TVpcRD1ZT1KG4TrFhE= -git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230706140617-98cab7ed6166 h1:HSwD/CDbrUp45gQmfn9KYag8zN0GD+HA0l2+U+c3Ayo= -git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230706140617-98cab7ed6166/go.mod h1:r5Fir/4jCVXzdfOyCUbikSDB99nVqnHNq7mzVcidnlA= git.frostfs.info/TrueCloudLab/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc= git.frostfs.info/TrueCloudLab/hrw v1.2.1/go.mod h1:C1Ygde2n843yTZEQ0FP69jYiuaYV0kriLvP4zm8JuvM= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjqZzS4gsb4UA= git.frostfs.info/TrueCloudLab/tzhash v1.8.0/go.mod h1:dhY+oy274hV8wGvGL4MwwMpdL3GYvaX1a8GQZQHvlF8= +git.frostfs.info/aarifullin/frostfs-api-go/v2 v2.15.1-0.20230710090848-bc16a32c24c3 h1:QuPPpzIaS6GGKgwDnhMLKjgS9iHO6e/3sQtFIUX0LMc= +git.frostfs.info/aarifullin/frostfs-api-go/v2 v2.15.1-0.20230710090848-bc16a32c24c3/go.mod h1:pKJJRLOChW4zDQsAt1e8k/snWKljJtpkiPfxV53ngjI= +git.frostfs.info/aarifullin/frostfs-sdk-go v0.0.0-20230712160837-6281a25556ae h1:L1rcvPZbhGs13kxFDVyNQFPC3DhKrEX56JKIAyrLhVg= +git.frostfs.info/aarifullin/frostfs-sdk-go v0.0.0-20230712160837-6281a25556ae/go.mod h1:w70mg6mJpw1Cku1uPVpA7Kk08ZQsbHGW2hYpTDJD6tQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= diff --git a/pkg/core/container/delete.go b/pkg/core/container/delete.go index 8e0aaebb9..13516650e 100644 --- a/pkg/core/container/delete.go +++ b/pkg/core/container/delete.go @@ -1,7 +1,7 @@ package container import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) @@ -14,7 +14,7 @@ type RemovalWitness struct { ContainerID cid.ID // Signature the signature of the container identifier. - Signature *refs.Signature + Signature *refsGRPC.Signature // SessionToken the token of the session within // which the container was removed. diff --git a/pkg/core/netmap/nodes.go b/pkg/core/netmap/nodes.go index 17fccc620..cd96ae08a 100644 --- a/pkg/core/netmap/nodes.go +++ b/pkg/core/netmap/nodes.go @@ -1,24 +1,26 @@ package netmap -import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" +import ( + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" +) // Node is a named type of netmap.NodeInfo which provides interface needed // in the current repository. Node is expected to be used everywhere instead // of direct usage of netmap.NodeInfo, so it represents a type mediator. -type Node netmap.NodeInfo +type Node netmapGRPC.NodeInfo // PublicKey returns public key bound to the storage node. // // Return value MUST NOT be mutated, make a copy first. func (x Node) PublicKey() []byte { - return (netmap.NodeInfo)(x).PublicKey() + return (netmapGRPC.NodeInfo)(x).PublicKey() } // IterateAddresses iterates over all announced network addresses // and passes them into f. Handler MUST NOT be nil. func (x Node) IterateAddresses(f func(string) bool) { - (netmap.NodeInfo)(x).IterateNetworkEndpoints(f) - for _, addr := range (netmap.NodeInfo)(x).ExternalAddresses() { + (netmapGRPC.NodeInfo)(x).IterateNetworkEndpoints(f) + for _, addr := range (netmapGRPC.NodeInfo)(x).ExternalAddresses() { if f(addr) { return } @@ -27,15 +29,15 @@ func (x Node) IterateAddresses(f func(string) bool) { // NumberOfAddresses returns number of announced network addresses. func (x Node) NumberOfAddresses() int { - return (netmap.NodeInfo)(x).NumberOfNetworkEndpoints() + return (netmapGRPC.NodeInfo)(x).NumberOfNetworkEndpoints() } // ExternalAddresses returns external addresses of a node. func (x Node) ExternalAddresses() []string { - return (netmap.NodeInfo)(x).ExternalAddresses() + return (netmapGRPC.NodeInfo)(x).ExternalAddresses() } // Nodes is a named type of []netmap.NodeInfo which provides interface needed // in the current repository. Nodes is expected to be used everywhere instead // of direct usage of []netmap.NodeInfo, so it represents a type mediator. -type Nodes []netmap.NodeInfo +type Nodes []netmapGRPC.NodeInfo diff --git a/pkg/core/object/fmt.go b/pkg/core/object/fmt.go index abf8f02cb..e23b40959 100644 --- a/pkg/core/object/fmt.go +++ b/pkg/core/object/fmt.go @@ -8,7 +8,7 @@ import ( "strconv" objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -139,7 +139,7 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error { return errors.New("missing signature") } - var sigV2 refs.Signature + var sigV2 refsGRPC.Signature sig.WriteToV2(&sigV2) binKey := sigV2.GetKey() @@ -240,7 +240,7 @@ func (v *FormatValidator) fillAndValidateLockMeta(o *objectSDK.Object, meta *Con return fmt.Errorf("lock object expiration: %d; current: %d", lockExp, currEpoch) } - var lock objectSDK.Lock + lock := objectSDK.NewLock() if err = lock.Unmarshal(o.Payload()); err != nil { return fmt.Errorf("decode lock payload: %w", err) @@ -323,11 +323,11 @@ func (v *FormatValidator) checkExpiration(ctx context.Context, obj *objectSDK.Ob func expirationEpochAttribute(obj *objectSDK.Object) (uint64, error) { for _, a := range obj.Attributes() { - if a.Key() != objectV2.SysAttributeExpEpoch && a.Key() != objectV2.SysAttributeExpEpochNeoFS { + if a.GetKey() != objectV2.SysAttributeExpEpoch && a.GetKey() != objectV2.SysAttributeExpEpochNeoFS { continue } - return strconv.ParseUint(a.Value(), 10, 64) + return strconv.ParseUint(a.GetValue(), 10, 64) } return 0, errNoExpirationEpoch @@ -344,13 +344,13 @@ func (v *FormatValidator) checkAttributes(obj *objectSDK.Object) error { mUnique := make(map[string]struct{}, len(as)) for _, a := range as { - key := a.Key() + key := a.GetKey() if _, was := mUnique[key]; was { return errDuplAttr } - if a.Value() == "" { + if a.GetValue() == "" { return errEmptyAttrVal } diff --git a/pkg/core/object/fmt_test.go b/pkg/core/object/fmt_test.go index d04c16709..32f518ea8 100644 --- a/pkg/core/object/fmt_test.go +++ b/pkg/core/object/fmt_test.go @@ -141,7 +141,7 @@ func TestFormatValidator_Validate(t *testing.T) { _, err = v.ValidateContent(obj) require.Error(t, err) // no expiration epoch in tombstone - var expirationAttribute objectSDK.Attribute + expirationAttribute := *objectSDK.NewAttribute() expirationAttribute.SetKey(objectV2.SysAttributeExpEpoch) expirationAttribute.SetValue(strconv.Itoa(10)) @@ -170,11 +170,11 @@ func TestFormatValidator_Validate(t *testing.T) { fn := func(val string) *objectSDK.Object { obj := blankValidObject(&ownerKey.PrivateKey) - var a objectSDK.Attribute + a := objectSDK.NewAttribute() a.SetKey(objectV2.SysAttributeExpEpoch) a.SetValue(val) - obj.SetAttributes(a) + obj.SetAttributes(*a) require.NoError(t, objectSDK.SetIDWithSignature(ownerKey.PrivateKey, obj)) @@ -204,7 +204,6 @@ func TestFormatValidator_Validate(t *testing.T) { addr.SetContainer(cID) addr.SetObject(oID) ls.m[addr] = true - err := v.Validate(context.Background(), obj, false) require.NoError(t, err) }) @@ -221,11 +220,11 @@ func TestFormatValidator_Validate(t *testing.T) { t.Run("duplication", func(t *testing.T) { obj := blankValidObject(&ownerKey.PrivateKey) - var a1 objectSDK.Attribute + a1 := *objectSDK.NewAttribute() a1.SetKey("key1") a1.SetValue("val1") - var a2 objectSDK.Attribute + a2 := *objectSDK.NewAttribute() a2.SetKey("key2") a2.SetValue("val2") @@ -234,7 +233,7 @@ func TestFormatValidator_Validate(t *testing.T) { err := v.checkAttributes(obj) require.NoError(t, err) - a2.SetKey(a1.Key()) + a2.SetKey(a1.GetKey()) obj.SetAttributes(a1, a2) err = v.checkAttributes(obj) @@ -244,10 +243,10 @@ func TestFormatValidator_Validate(t *testing.T) { t.Run("empty value", func(t *testing.T) { obj := blankValidObject(&ownerKey.PrivateKey) - var a objectSDK.Attribute + a := objectSDK.NewAttribute() a.SetKey("key") - obj.SetAttributes(a) + obj.SetAttributes(*a) err := v.checkAttributes(obj) require.Equal(t, errEmptyAttrVal, err) diff --git a/pkg/core/version/version.go b/pkg/core/version/version.go index eb759a993..4c98f60f8 100644 --- a/pkg/core/version/version.go +++ b/pkg/core/version/version.go @@ -11,7 +11,7 @@ func IsValid(v version.Version) bool { startMinor = 7 ) - mjr := v.Major() + mjr := v.GetMajor() - return mjr > startMajor || mjr == startMajor && v.Minor() >= startMinor + return mjr > startMajor || mjr == startMajor && v.GetMinor() >= startMinor } diff --git a/pkg/core/version/version_test.go b/pkg/core/version/version_test.go index 1ef18c521..a58efe69b 100644 --- a/pkg/core/version/version_test.go +++ b/pkg/core/version/version_test.go @@ -11,7 +11,7 @@ import ( func TestIsValid(t *testing.T) { require.True(t, version.IsValid(versionSDK.Current())) - var v versionSDK.Version + v := versionSDK.NewVersion() for _, item := range []struct { mjr, mnr uint32 diff --git a/pkg/innerring/processors/alphabet/handlers_test.go b/pkg/innerring/processors/alphabet/handlers_test.go index c098ca27d..e694cd5dd 100644 --- a/pkg/innerring/processors/alphabet/handlers_test.go +++ b/pkg/innerring/processors/alphabet/handlers_test.go @@ -27,12 +27,12 @@ func TestProcessorEmitsGasToNetmapAndAlphabet(t *testing.T) { morphClient := &testMorphClient{} - var node1 netmap.NodeInfo + node1 := netmap.NewNodeInfo() key1, err := keys.NewPublicKeyFromString("038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35") require.NoError(t, err, "failed to parse key1") node1.SetPublicKey(key1.Bytes()) - var node2 netmap.NodeInfo + node2 := netmap.NewNodeInfo() key2, err := keys.NewPublicKeyFromString("02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3") require.NoError(t, err, "failed to parse key2") node2.SetPublicKey(key2.Bytes()) @@ -104,12 +104,12 @@ func TestProcessorEmitsGasToNetmapIfNoParsedWallets(t *testing.T) { morphClient := &testMorphClient{} - var node1 netmap.NodeInfo + node1 := netmap.NewNodeInfo() key1, err := keys.NewPublicKeyFromString("038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35") require.NoError(t, err, "failed to parse key1") node1.SetPublicKey(key1.Bytes()) - var node2 netmap.NodeInfo + node2 := netmap.NewNodeInfo() key2, err := keys.NewPublicKeyFromString("02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3") require.NoError(t, err, "failed to parse key2") node2.SetPublicKey(key2.Bytes()) diff --git a/pkg/innerring/processors/container/common.go b/pkg/innerring/processors/container/common.go index 97eb6f559..c90a4e46a 100644 --- a/pkg/innerring/processors/container/common.go +++ b/pkg/innerring/processors/container/common.go @@ -106,7 +106,7 @@ func (cp *Processor) checkTokenLifetime(token session.Container) error { } func (cp *Processor) verifyByTokenSession(v signatureVerificationData, key *frostfsecdsa.PublicKeyRFC6979, keyProvided bool) error { - var tok session.Container + tok := session.NewContainer() err := tok.Unmarshal(v.binTokenSession) if err != nil { diff --git a/pkg/innerring/processors/container/handlers_test.go b/pkg/innerring/processors/container/handlers_test.go index 1e518f474..e449d534f 100644 --- a/pkg/innerring/processors/container/handlers_test.go +++ b/pkg/innerring/processors/container/handlers_test.go @@ -55,12 +55,12 @@ func TestPutEvent(t *testing.T) { var pp netmap.PlacementPolicy pp.AddReplicas(netmap.ReplicaDescriptor{}) - var cnr containerSDK.Container + cnr := containerSDK.NewContainer() cnr.Init() cnr.SetOwner(usr) cnr.SetPlacementPolicy(pp) cnr.SetBasicACL(acl.Private) - containerSDK.DisableHomomorphicHashing(&cnr) + containerSDK.DisableHomomorphicHashing(cnr) nr := &payload.P2PNotaryRequest{ MainTransaction: &transaction.Transaction{}, @@ -119,12 +119,12 @@ func TestDeleteEvent(t *testing.T) { var pp netmap.PlacementPolicy pp.AddReplicas(netmap.ReplicaDescriptor{}) - var cnr containerSDK.Container + cnr := containerSDK.NewContainer() cnr.Init() cnr.SetOwner(usr) cnr.SetPlacementPolicy(pp) cnr.SetBasicACL(acl.Private) - containerSDK.DisableHomomorphicHashing(&cnr) + containerSDK.DisableHomomorphicHashing(cnr) var cid cid.ID containerSDK.CalculateID(&cid, cnr) @@ -141,7 +141,7 @@ func TestDeleteEvent(t *testing.T) { NotaryRequestValue: nr, } - var signature frostfscrypto.Signature + signature := frostfscrypto.NewSignature() signer := frostfsecdsa.Signer(p.PrivateKey) require.NoError(t, signature.Calculate(signer, ev.ContainerID()), "failed to calculate signature") cc.get[hex.EncodeToString(ev.ContainerID())] = &containercore.Container{ @@ -193,19 +193,19 @@ func TestSetEACLEvent(t *testing.T) { var pp netmap.PlacementPolicy pp.AddReplicas(netmap.ReplicaDescriptor{}) - var cnr containerSDK.Container + cnr := containerSDK.NewContainer() cnr.Init() cnr.SetOwner(usr) cnr.SetPlacementPolicy(pp) cnr.SetBasicACL(acl.PrivateExtended) - containerSDK.DisableHomomorphicHashing(&cnr) + containerSDK.DisableHomomorphicHashing(cnr) var cid cid.ID containerSDK.CalculateID(&cid, cnr) cidBytes := make([]byte, 32) cid.Encode(cidBytes) - var signature frostfscrypto.Signature + signature := frostfscrypto.NewSignature() signer := frostfsecdsa.Signer(p.PrivateKey) require.NoError(t, signature.Calculate(signer, cidBytes), "failed to calculate signature") @@ -282,7 +282,7 @@ func (c *testContainerClient) Get(cid []byte) (*containercore.Container, error) if cont, found := c.get[key]; found { return cont, nil } - return nil, apistatus.ContainerNotFound{} + return nil, apistatus.NewContainerNotFound() } type testIDClient struct { diff --git a/pkg/innerring/processors/container/process_container.go b/pkg/innerring/processors/container/process_container.go index 2629b9d29..b6de0a268 100644 --- a/pkg/innerring/processors/container/process_container.go +++ b/pkg/innerring/processors/container/process_container.go @@ -62,7 +62,7 @@ func (cp *Processor) processContainerPut(put putEvent) bool { func (cp *Processor) checkPutContainer(ctx *putContainerContext) error { binCnr := ctx.e.Container() - var cnr containerSDK.Container + cnr := containerSDK.NewContainer() err := cnr.Unmarshal(binCnr) if err != nil { diff --git a/pkg/innerring/processors/netmap/cleanup_table_test.go b/pkg/innerring/processors/netmap/cleanup_table_test.go index 959710393..f002fb102 100644 --- a/pkg/innerring/processors/netmap/cleanup_table_test.go +++ b/pkg/innerring/processors/netmap/cleanup_table_test.go @@ -128,6 +128,7 @@ func TestCleanupTable(t *testing.T) { } func newNodeInfo(key *keys.PublicKey) (n netmap.NodeInfo) { + n = netmap.NewNodeInfo() n.SetPublicKey(key.Bytes()) return n } diff --git a/pkg/innerring/processors/netmap/handlers_test.go b/pkg/innerring/processors/netmap/handlers_test.go index 6c9e265cc..e2163526d 100644 --- a/pkg/innerring/processors/netmap/handlers_test.go +++ b/pkg/innerring/processors/netmap/handlers_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" netmapContract "git.frostfs.info/TrueCloudLab/frostfs-contract/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/processors/governance" timerEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/timers" @@ -50,12 +50,12 @@ func TestNewEpochTick(t *testing.T) { func TestNewEpoch(t *testing.T) { t.Parallel() - var node1 netmap.NodeInfo + node1 := netmap.NewNodeInfo() key1, err := keys.NewPublicKeyFromString("038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35") require.NoError(t, err, "failed to parse key1") node1.SetPublicKey(key1.Bytes()) - var node2 netmap.NodeInfo + node2 := netmap.NewNodeInfo() key2, err := keys.NewPublicKeyFromString("02ac920cd7df0b61b289072e6b946e2da4e1a31b9ab1c621bb475e30fa4ab102c3") require.NoError(t, err, "failed to parse key2") node2.SetPublicKey(key2.Bytes()) @@ -127,7 +127,7 @@ func TestAddPeer(t *testing.T) { require.NoError(t, err, "failed to create processor") - var node netmap.NodeInfo + node := netmap.NewNodeInfo() key, err := keys.NewPublicKeyFromString("038c862959e56b43e20f79187c4fe9e0bc7c8c66c1603e6cf0ec7f87ab6b08dc35") require.NoError(t, err, "failed to parse key") node.SetPublicKey(key.Bytes()) @@ -245,7 +245,7 @@ func TestCleanupTick(t *testing.T) { nonce: uint32(ev.epoch), vub: nil, method: "updateStateIR", - args: []any{int64(v2netmap.Offline), keyExp.Bytes()}, + args: []any{int64(v2netmap.NodeInfo_OFFLINE), keyExp.Bytes()}, }, }, nc.notaryInvokes, "invalid notary invokes") require.True(t, proc.netmapSnapshot.lastAccess[key1Str].removeFlag, "invalid expired removed flag") diff --git a/pkg/innerring/processors/netmap/nodevalidation/locode/calls_test.go b/pkg/innerring/processors/netmap/nodevalidation/locode/calls_test.go index 6697391e8..60e5d11ff 100644 --- a/pkg/innerring/processors/netmap/nodevalidation/locode/calls_test.go +++ b/pkg/innerring/processors/netmap/nodevalidation/locode/calls_test.go @@ -43,7 +43,7 @@ func addLocodeAttr(n *netmap.NodeInfo, lc locodestd.LOCODE) { } func nodeInfoWithSomeAttrs() *netmap.NodeInfo { - var n netmap.NodeInfo + n := netmap.NewNodeInfo() n.SetAttribute("key1", "val1") n.SetAttribute("key2", "val2") diff --git a/pkg/innerring/processors/netmap/nodevalidation/state/validator_test.go b/pkg/innerring/processors/netmap/nodevalidation/state/validator_test.go index a557628f0..0a472e7a3 100644 --- a/pkg/innerring/processors/netmap/nodevalidation/state/validator_test.go +++ b/pkg/innerring/processors/netmap/nodevalidation/state/validator_test.go @@ -66,7 +66,7 @@ func TestValidator_VerifyAndUpdate(t *testing.T) { }, }, } { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() // prepare node testCase.preparer(&node) diff --git a/pkg/innerring/processors/netmap/process_cleanup.go b/pkg/innerring/processors/netmap/process_cleanup.go index 170c39e2c..970c0c6c7 100644 --- a/pkg/innerring/processors/netmap/process_cleanup.go +++ b/pkg/innerring/processors/netmap/process_cleanup.go @@ -1,7 +1,7 @@ package netmap import ( - v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + v2netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "go.uber.org/zap" @@ -36,7 +36,7 @@ func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) bool { uint32(ev.epoch), nil, methodUpdateStateNotary, - int64(v2netmap.Offline), key.Bytes(), + int64(v2netmap.NodeInfo_OFFLINE), key.Bytes(), ) if err != nil { np.log.Error(logs.NetmapCantInvokeNetmapUpdateState, zap.Error(err)) diff --git a/pkg/innerring/processors/netmap/process_peers.go b/pkg/innerring/processors/netmap/process_peers.go index 96b8c8e97..e05c240fb 100644 --- a/pkg/innerring/processors/netmap/process_peers.go +++ b/pkg/innerring/processors/netmap/process_peers.go @@ -30,7 +30,7 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) bool { } // unmarshal node info - var nodeInfo netmap.NodeInfo + nodeInfo := netmap.NewNodeInfo() if err := nodeInfo.Unmarshal(ev.Node()); err != nil { // it will be nice to have tx id at event structure to log it np.log.Warn(logs.NetmapCantParseNetworkMapCandidate) diff --git a/pkg/local_object_storage/blobovnicza/delete.go b/pkg/local_object_storage/blobovnicza/delete.go index 8fbd363db..1f3446750 100644 --- a/pkg/local_object_storage/blobovnicza/delete.go +++ b/pkg/local_object_storage/blobovnicza/delete.go @@ -77,7 +77,7 @@ func (b *Blobovnicza) Delete(ctx context.Context, prm DeletePrm) (DeleteRes, err }) if err == nil && !found { - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() return DeleteRes{}, errNotFound } diff --git a/pkg/local_object_storage/blobovnicza/get.go b/pkg/local_object_storage/blobovnicza/get.go index d492b7559..628166cbb 100644 --- a/pkg/local_object_storage/blobovnicza/get.go +++ b/pkg/local_object_storage/blobovnicza/get.go @@ -72,7 +72,7 @@ func (b *Blobovnicza) Get(ctx context.Context, prm GetPrm) (GetRes, error) { } if data == nil { - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() return GetRes{}, errNotFound } diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/delete.go b/pkg/local_object_storage/blobstor/blobovniczatree/delete.go index 4d0801ef1..1f29457d5 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/delete.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/delete.go @@ -89,7 +89,7 @@ func (b *Blobovniczas) Delete(ctx context.Context, prm common.DeletePrm) (res co if err == nil && !objectFound { // not found in any blobovnicza - return common.DeleteRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.DeleteRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } success = err == nil @@ -142,7 +142,7 @@ func (b *Blobovniczas) deleteObjectFromLevel(ctx context.Context, prm blobovnicz // (Blobovniczas "after" the active one are empty anyway, // and it's pointless to open them). if u64FromHexString(filepath.Base(blzPath)) > active.ind { - return common.DeleteRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.DeleteRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } // open blobovnicza (cached inside) diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/get.go b/pkg/local_object_storage/blobstor/blobovniczatree/get.go index e88310f8a..0d3d03407 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/get.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/get.go @@ -85,7 +85,7 @@ func (b *Blobovniczas) Get(ctx context.Context, prm common.GetPrm) (res common.G if err == nil && res.Object == nil { // not found in any blobovnicza - return res, logicerr.Wrap(apistatus.ObjectNotFound{}) + return res, logicerr.Wrap(apistatus.NewObjectNotFound()) } success = true @@ -141,7 +141,7 @@ func (b *Blobovniczas) getObjectFromLevel(ctx context.Context, prm blobovnicza.G // (Blobovniczas "after" the active one are empty anyway, // and it's pointless to open them). if u64FromHexString(filepath.Base(blzPath)) > active.ind { - return common.GetRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } // open blobovnicza (cached inside) diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/get_range.go b/pkg/local_object_storage/blobstor/blobovniczatree/get_range.go index 8579502c0..3eb971d4e 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/get_range.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/get_range.go @@ -91,7 +91,7 @@ func (b *Blobovniczas) GetRange(ctx context.Context, prm common.GetRangePrm) (re if err == nil && !objectFound { // not found in any blobovnicza - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } if err == nil { @@ -159,7 +159,7 @@ func (b *Blobovniczas) getRangeFromLevel(ctx context.Context, prm common.GetRang // (Blobovniczas "after" the active one are empty anyway, // and it's pointless to open them). if u64FromHexString(filepath.Base(blzPath)) > active.ind { - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } // open blobovnicza (cached inside) @@ -202,7 +202,7 @@ func (b *Blobovniczas) getObjectRange(ctx context.Context, blz *blobovnicza.Blob payload := obj.Payload() if pLen := uint64(len(payload)); to < from || pLen < from || pLen < to { - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectOutOfRange{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectOutOfRange()) } return common.GetRangeRes{ diff --git a/pkg/local_object_storage/blobstor/blobstor_test.go b/pkg/local_object_storage/blobstor/blobstor_test.go index ef85f0f1d..d64b172ec 100644 --- a/pkg/local_object_storage/blobstor/blobstor_test.go +++ b/pkg/local_object_storage/blobstor/blobstor_test.go @@ -66,11 +66,11 @@ func TestCompression(t *testing.T) { testGet := func(t *testing.T, b *BlobStor, i int) { res1, err := b.Get(context.Background(), common.GetPrm{Address: object.AddressOf(smallObj[i])}) require.NoError(t, err) - require.Equal(t, smallObj[i], res1.Object) + require.True(t, smallObj[i].Equal(res1.Object)) res2, err := b.Get(context.Background(), common.GetPrm{Address: object.AddressOf(bigObj[i])}) require.NoError(t, err) - require.Equal(t, bigObj[i], res2.Object) + require.True(t, bigObj[i].Equal(res2.Object)) } testPut := func(t *testing.T, b *BlobStor, i int) { @@ -134,7 +134,7 @@ func TestBlobstor_needsCompression(t *testing.T) { newObjectWithCt := func(contentType string) *objectSDK.Object { obj := testObject(smallSizeLimit + 1) if contentType != "" { - var a objectSDK.Attribute + a := *objectSDK.NewAttribute() a.SetKey(objectSDK.AttributeContentType) a.SetValue(contentType) obj.SetAttributes(a) @@ -194,7 +194,7 @@ func TestConcurrentPut(t *testing.T) { testGet := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { res, err := b.Get(context.Background(), common.GetPrm{Address: object.AddressOf(obj)}) require.NoError(t, err) - require.Equal(t, obj, res.Object) + require.True(t, obj.Equal(res.Object)) } testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { diff --git a/pkg/local_object_storage/blobstor/compression/compress.go b/pkg/local_object_storage/blobstor/compression/compress.go index 4ebf057d3..6d207da13 100644 --- a/pkg/local_object_storage/blobstor/compression/compress.go +++ b/pkg/local_object_storage/blobstor/compression/compress.go @@ -50,16 +50,16 @@ func (c *Config) NeedsCompression(obj *objectSDK.Object) bool { } for _, attr := range obj.Attributes() { - if attr.Key() == objectSDK.AttributeContentType { + if attr.GetKey() == objectSDK.AttributeContentType { for _, value := range c.UncompressableContentTypes { match := false switch { case len(value) > 0 && value[len(value)-1] == '*': - match = strings.HasPrefix(attr.Value(), value[:len(value)-1]) + match = strings.HasPrefix(attr.GetValue(), value[:len(value)-1]) case len(value) > 0 && value[0] == '*': - match = strings.HasSuffix(attr.Value(), value[1:]) + match = strings.HasSuffix(attr.GetValue(), value[1:]) default: - match = attr.Value() == value + match = attr.GetValue() == value } if match { return false diff --git a/pkg/local_object_storage/blobstor/fstree/fstree.go b/pkg/local_object_storage/blobstor/fstree/fstree.go index 9ca5d4bd9..3ba227d00 100644 --- a/pkg/local_object_storage/blobstor/fstree/fstree.go +++ b/pkg/local_object_storage/blobstor/fstree/fstree.go @@ -246,7 +246,7 @@ func (t *FSTree) Delete(ctx context.Context, prm common.DeletePrm) (common.Delet err = os.Remove(p) if err != nil && os.IsNotExist(err) { - err = logicerr.Wrap(apistatus.ObjectNotFound{}) + err = logicerr.Wrap(apistatus.NewObjectNotFound()) } return common.DeleteRes{}, err } @@ -439,7 +439,7 @@ func (t *FSTree) Get(ctx context.Context, prm common.GetPrm) (common.GetRes, err p := t.treePath(prm.Address) if _, err := os.Stat(p); os.IsNotExist(err) { - return common.GetRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } var data []byte @@ -498,7 +498,7 @@ func (t *FSTree) GetRange(ctx context.Context, prm common.GetRangePrm) (common.G to := from + prm.Range.GetLength() if pLen := uint64(len(payload)); to < from || pLen < from || pLen < to { - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectOutOfRange{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectOutOfRange()) } success = true diff --git a/pkg/local_object_storage/blobstor/get.go b/pkg/local_object_storage/blobstor/get.go index fab86ea5d..57119d887 100644 --- a/pkg/local_object_storage/blobstor/get.go +++ b/pkg/local_object_storage/blobstor/get.go @@ -44,7 +44,7 @@ func (b *BlobStor) Get(ctx context.Context, prm common.GetPrm) (res common.GetRe } } - return common.GetRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } if len(prm.StorageID) == 0 { res, err = b.storage[len(b.storage)-1].Storage.Get(ctx, prm) diff --git a/pkg/local_object_storage/blobstor/get_range.go b/pkg/local_object_storage/blobstor/get_range.go index 671fbf02e..9de0e38b7 100644 --- a/pkg/local_object_storage/blobstor/get_range.go +++ b/pkg/local_object_storage/blobstor/get_range.go @@ -46,7 +46,7 @@ func (b *BlobStor) GetRange(ctx context.Context, prm common.GetRangePrm) (res co } } - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } if len(prm.StorageID) == 0 { res, err = b.storage[len(b.storage)-1].Storage.GetRange(ctx, prm) diff --git a/pkg/local_object_storage/blobstor/internal/blobstortest/get.go b/pkg/local_object_storage/blobstor/internal/blobstortest/get.go index c5755dfba..d0be79dc2 100644 --- a/pkg/local_object_storage/blobstor/internal/blobstortest/get.go +++ b/pkg/local_object_storage/blobstor/internal/blobstortest/get.go @@ -32,13 +32,13 @@ func TestGet(t *testing.T, cons Constructor, min, max uint64) { gPrm.StorageID = objects[i].storageID res, err := s.Get(context.Background(), gPrm) require.NoError(t, err) - require.Equal(t, objects[i].obj, res.Object) + require.True(t, objects[i].obj.Equal(res.Object)) // Without storage ID. gPrm.StorageID = nil res, err = s.Get(context.Background(), gPrm) require.NoError(t, err) - require.Equal(t, objects[i].obj, res.Object) + require.True(t, objects[i].obj.Equal(res.Object)) // With raw flag. gPrm.StorageID = objects[i].storageID @@ -46,6 +46,6 @@ func TestGet(t *testing.T, cons Constructor, min, max uint64) { res, err = s.Get(context.Background(), gPrm) require.NoError(t, err) - require.Equal(t, objects[i].raw, res.RawData) + require.True(t, objects[i].obj.Equal(res.Object)) } } diff --git a/pkg/local_object_storage/blobstor/internal/blobstortest/get_range.go b/pkg/local_object_storage/blobstor/internal/blobstortest/get_range.go index b0c8aa95a..5ef2e7944 100644 --- a/pkg/local_object_storage/blobstor/internal/blobstortest/get_range.go +++ b/pkg/local_object_storage/blobstor/internal/blobstortest/get_range.go @@ -7,6 +7,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test" "github.com/stretchr/testify/require" ) @@ -34,6 +35,7 @@ func TestGetRange(t *testing.T, cons Constructor, min, max uint64) { var gPrm common.GetRangePrm gPrm.Address = objects[0].addr + gPrm.Range = *object.NewRange() gPrm.Range.SetOffset(start) gPrm.Range.SetLength(stop - start) diff --git a/pkg/local_object_storage/blobstor/memstore/memstore.go b/pkg/local_object_storage/blobstor/memstore/memstore.go index b6cca2551..2764cb499 100644 --- a/pkg/local_object_storage/blobstor/memstore/memstore.go +++ b/pkg/local_object_storage/blobstor/memstore/memstore.go @@ -41,7 +41,7 @@ func (s *memstoreImpl) Get(_ context.Context, req common.GetPrm) (common.GetRes, s.mu.RUnlock() if !exists { - return common.GetRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.GetRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } // Decompress the data. @@ -73,7 +73,7 @@ func (s *memstoreImpl) GetRange(ctx context.Context, req common.GetRangePrm) (co to := from + req.Range.GetLength() if pLen := uint64(len(payload)); to < from || pLen < from || pLen < to { - return common.GetRangeRes{}, logicerr.Wrap(apistatus.ObjectOutOfRange{}) + return common.GetRangeRes{}, logicerr.Wrap(apistatus.NewObjectOutOfRange()) } return common.GetRangeRes{ @@ -123,7 +123,7 @@ func (s *memstoreImpl) Delete(_ context.Context, req common.DeletePrm) (common.D return common.DeleteRes{}, nil } - return common.DeleteRes{}, logicerr.Wrap(apistatus.ObjectNotFound{}) + return common.DeleteRes{}, logicerr.Wrap(apistatus.NewObjectNotFound()) } func (s *memstoreImpl) Iterate(_ context.Context, req common.IteratePrm) (common.IterateRes, error) { diff --git a/pkg/local_object_storage/blobstor/memstore/memstore_test.go b/pkg/local_object_storage/blobstor/memstore/memstore_test.go index 125276290..4c9ab6540 100644 --- a/pkg/local_object_storage/blobstor/memstore/memstore_test.go +++ b/pkg/local_object_storage/blobstor/memstore/memstore_test.go @@ -45,7 +45,7 @@ func TestSimpleLifecycle(t *testing.T) { } { - var objRange objectSDK.Range + objRange := *objectSDK.NewRange() objRange.SetOffset(256) objRange.SetLength(512) resp, err := s.GetRange(context.Background(), common.GetRangePrm{ diff --git a/pkg/local_object_storage/engine/delete_test.go b/pkg/local_object_storage/engine/delete_test.go index bbc27615a..59484fe61 100644 --- a/pkg/local_object_storage/engine/delete_test.go +++ b/pkg/local_object_storage/engine/delete_test.go @@ -84,10 +84,10 @@ func TestDeleteBigObject(t *testing.T) { _, err := e.Delete(context.Background(), deletePrm) require.NoError(t, err) - checkGetError(t, e, addrParent, &apistatus.ObjectNotFound{}) - checkGetError(t, e, addrLink, &apistatus.ObjectNotFound{}) + checkGetError(t, e, addrParent, apistatus.NewObjectNotFound()) + checkGetError(t, e, addrLink, apistatus.NewObjectNotFound()) for i := range children { - checkGetError(t, e, object.AddressOf(children[i]), &apistatus.ObjectNotFound{}) + checkGetError(t, e, object.AddressOf(children[i]), apistatus.NewObjectNotFound()) } } diff --git a/pkg/local_object_storage/engine/error_test.go b/pkg/local_object_storage/engine/error_test.go index 18bc72d65..c344a9a15 100644 --- a/pkg/local_object_storage/engine/error_test.go +++ b/pkg/local_object_storage/engine/error_test.go @@ -209,7 +209,7 @@ func TestBlobstorFailback(t *testing.T) { addr := object.AddressOf(objs[i]) getRes, err := te.ng.Get(context.Background(), GetPrm{addr: addr}) require.NoError(t, err) - require.Equal(t, objs[i], getRes.Object()) + require.True(t, objs[i].Equal(getRes.Object())) rngRes, err := te.ng.GetRange(context.Background(), RngPrm{addr: addr, off: 1, ln: 10}) require.NoError(t, err) diff --git a/pkg/local_object_storage/engine/evacuate_test.go b/pkg/local_object_storage/engine/evacuate_test.go index 13ac59f24..a7de717e7 100644 --- a/pkg/local_object_storage/engine/evacuate_test.go +++ b/pkg/local_object_storage/engine/evacuate_test.go @@ -150,7 +150,7 @@ func TestEvacuateNetwork(t *testing.T) { n++ for i := range objects { if addr == objectCore.AddressOf(objects[i]) { - require.Equal(t, objects[i], obj) + require.True(t, objects[i].Equal(obj)) return nil } } diff --git a/pkg/local_object_storage/engine/exists.go b/pkg/local_object_storage/engine/exists.go index 6208461e9..abe15acea 100644 --- a/pkg/local_object_storage/engine/exists.go +++ b/pkg/local_object_storage/engine/exists.go @@ -48,7 +48,7 @@ func (e *StorageEngine) exists(ctx context.Context, addr oid.Address) (bool, err }) if alreadyRemoved { - var errRemoved apistatus.ObjectAlreadyRemoved + errRemoved := apistatus.NewObjectAlreadyRemoved() return false, errRemoved } diff --git a/pkg/local_object_storage/engine/get.go b/pkg/local_object_storage/engine/get.go index bd094770a..9e41ae451 100644 --- a/pkg/local_object_storage/engine/get.go +++ b/pkg/local_object_storage/engine/get.go @@ -67,7 +67,7 @@ func (e *StorageEngine) get(ctx context.Context, prm GetPrm) (GetRes, error) { defer elapsed("Get", e.metrics.AddMethodDuration)() } - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() var shPrm shard.GetPrm shPrm.SetAddress(prm.addr) diff --git a/pkg/local_object_storage/engine/head.go b/pkg/local_object_storage/engine/head.go index ca51015db..4c4f688b4 100644 --- a/pkg/local_object_storage/engine/head.go +++ b/pkg/local_object_storage/engine/head.go @@ -75,7 +75,7 @@ func (e *StorageEngine) head(ctx context.Context, prm HeadPrm) (HeadRes, error) head *objectSDK.Object siErr *objectSDK.SplitInfoError - errNotFound apistatus.ObjectNotFound + errNotFound = apistatus.NewObjectNotFound() outSI *objectSDK.SplitInfo outError error = errNotFound @@ -112,7 +112,7 @@ func (e *StorageEngine) head(ctx context.Context, prm HeadPrm) (HeadRes, error) return true // stop, return it back case shard.IsErrObjectExpired(err): - var notFoundErr apistatus.ObjectNotFound + notFoundErr := apistatus.NewObjectNotFound() // object is found but should not // be returned diff --git a/pkg/local_object_storage/engine/inhume.go b/pkg/local_object_storage/engine/inhume.go index 0b9ae602b..12f418060 100644 --- a/pkg/local_object_storage/engine/inhume.go +++ b/pkg/local_object_storage/engine/inhume.go @@ -94,7 +94,7 @@ func (e *StorageEngine) inhume(ctx context.Context, prm InhumePrm) (InhumeRes, e zap.Error(err), zap.Stringer("addr", prm.addrs[i])) } else if locked { - var lockedErr apistatus.ObjectLocked + lockedErr := apistatus.NewObjectLocked() return InhumeRes{}, lockedErr } } @@ -125,7 +125,7 @@ func (e *StorageEngine) inhume(ctx context.Context, prm InhumePrm) (InhumeRes, e // Returns ok if object was inhumed during this invocation or before. func (e *StorageEngine) inhumeAddr(ctx context.Context, addr oid.Address, prm shard.InhumePrm, checkExists bool) (bool, error) { root := false - var errLocked apistatus.ObjectLocked + errLocked := apistatus.NewObjectLocked() var existPrm shard.ExistsPrm var retErr error var ok bool @@ -165,7 +165,7 @@ func (e *StorageEngine) inhumeAddr(ctx context.Context, addr oid.Address, prm sh if err != nil { switch { case errors.As(err, &errLocked): - retErr = apistatus.ObjectLocked{} + retErr = apistatus.NewObjectLocked() return true case errors.Is(err, shard.ErrLockObjectRemoval): retErr = meta.ErrLockObjectRemoval diff --git a/pkg/local_object_storage/engine/lock.go b/pkg/local_object_storage/engine/lock.go index 61a5a0dc9..481871bd6 100644 --- a/pkg/local_object_storage/engine/lock.go +++ b/pkg/local_object_storage/engine/lock.go @@ -41,11 +41,11 @@ func (e *StorageEngine) lock(ctx context.Context, idCnr cid.ID, locker oid.ID, l for i := range locked { switch e.lockSingle(ctx, idCnr, locker, locked[i], true) { case 1: - return logicerr.Wrap(apistatus.LockNonRegularObject{}) + return logicerr.Wrap(apistatus.NewLockNonRegularObject()) case 0: switch e.lockSingle(ctx, idCnr, locker, locked[i], false) { case 1: - return logicerr.Wrap(apistatus.LockNonRegularObject{}) + return logicerr.Wrap(apistatus.NewLockNonRegularObject()) case 0: return logicerr.Wrap(errLockFailed) } @@ -62,7 +62,7 @@ func (e *StorageEngine) lock(ctx context.Context, idCnr cid.ID, locker oid.ID, l func (e *StorageEngine) lockSingle(ctx context.Context, idCnr cid.ID, locker, locked oid.ID, checkExists bool) (status uint8) { // code is pretty similar to inhumeAddr, maybe unify? root := false - var errIrregular apistatus.LockNonRegularObject + errIrregular := apistatus.NewLockNonRegularObject() var addrLocked oid.Address addrLocked.SetContainer(idCnr) diff --git a/pkg/local_object_storage/engine/lock_test.go b/pkg/local_object_storage/engine/lock_test.go index a7f0a1552..8bd4b459e 100644 --- a/pkg/local_object_storage/engine/lock_test.go +++ b/pkg/local_object_storage/engine/lock_test.go @@ -83,7 +83,7 @@ func TestLockUserScenario(t *testing.T) { lockerAddr.SetContainer(cnr) lockerAddr.SetObject(lockerID) - var a objectSDK.Attribute + a := *objectSDK.NewAttribute() a.SetKey(objectV2.SysAttributeExpEpoch) a.SetValue(strconv.Itoa(lockerExpiresAfter)) @@ -105,7 +105,7 @@ func TestLockUserScenario(t *testing.T) { require.NoError(t, err) // 2. - var locker objectSDK.Lock + locker := *objectSDK.NewLock() locker.WriteMembers([]oid.ID{id}) objectSDK.WriteLock(lockerObj, locker) @@ -188,7 +188,7 @@ func TestLockExpiration(t *testing.T) { require.NoError(t, err) // 2. - var a objectSDK.Attribute + a := *objectSDK.NewAttribute() a.SetKey(objectV2.SysAttributeExpEpoch) a.SetValue(strconv.Itoa(lockerExpiresAfter)) diff --git a/pkg/local_object_storage/engine/range.go b/pkg/local_object_storage/engine/range.go index 328df4587..033f17ed8 100644 --- a/pkg/local_object_storage/engine/range.go +++ b/pkg/local_object_storage/engine/range.go @@ -83,7 +83,7 @@ func (e *StorageEngine) getRange(ctx context.Context, prm RngPrm) (RngRes, error defer elapsed("GetRange", e.metrics.AddMethodDuration)() } - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() var shPrm shard.RngPrm shPrm.SetAddress(prm.addr) @@ -212,7 +212,7 @@ func (i *getRangeShardIterator) tryGetFromBlobstor(ctx context.Context) { res, err := sh.GetRange(ctx, i.ShardPrm) if shard.IsErrOutOfRange(err) { - var errOutOfRange apistatus.ObjectOutOfRange + errOutOfRange := apistatus.NewObjectOutOfRange() i.OutError = errOutOfRange return true diff --git a/pkg/local_object_storage/internal/testutil/object.go b/pkg/local_object_storage/internal/testutil/object.go index 9cbce27bf..a52c76a76 100644 --- a/pkg/local_object_storage/internal/testutil/object.go +++ b/pkg/local_object_storage/internal/testutil/object.go @@ -27,21 +27,21 @@ func GenerateObjectWithCID(cnr cid.ID) *objectSDK.Object { } func GenerateObjectWithCIDWithPayload(cnr cid.ID, data []byte) *objectSDK.Object { - var ver version.Version + ver := version.NewVersion() ver.SetMajor(2) ver.SetMinor(1) - var csum checksum.Checksum + csum := checksum.NewChecksum() csum.SetSHA256(sha256.Sum256(data)) - var csumTZ checksum.Checksum + csumTZ := checksum.NewChecksum() csumTZ.SetTillichZemor(tz.Sum(csum.Value())) obj := objectSDK.New() obj.SetID(oidtest.ID()) obj.SetOwnerID(usertest.ID()) obj.SetContainerID(cnr) - obj.SetVersion(&ver) + obj.SetVersion(ver) obj.SetPayload(data) obj.SetPayloadChecksum(csum) obj.SetPayloadHomomorphicHash(csumTZ) @@ -50,7 +50,7 @@ func GenerateObjectWithCIDWithPayload(cnr cid.ID, data []byte) *objectSDK.Object } func AddAttribute(obj *objectSDK.Object, key, val string) { - var attr objectSDK.Attribute + attr := *objectSDK.NewAttribute() attr.SetKey(key) attr.SetValue(val) diff --git a/pkg/local_object_storage/metabase/db_test.go b/pkg/local_object_storage/metabase/db_test.go index 9ef7bf8bc..133fb643a 100644 --- a/pkg/local_object_storage/metabase/db_test.go +++ b/pkg/local_object_storage/metabase/db_test.go @@ -76,7 +76,7 @@ func checkExpiredObjects(t *testing.T, db *meta.DB, f func(exp, nonExp *objectSD } func setExpiration(o *objectSDK.Object, epoch uint64) { - var attr objectSDK.Attribute + attr := *objectSDK.NewAttribute() attr.SetKey(objectV2.SysAttributeExpEpoch) attr.SetValue(strconv.FormatUint(epoch, 10)) diff --git a/pkg/local_object_storage/metabase/exists.go b/pkg/local_object_storage/metabase/exists.go index b6e5ea052..0101256aa 100644 --- a/pkg/local_object_storage/metabase/exists.go +++ b/pkg/local_object_storage/metabase/exists.go @@ -82,9 +82,9 @@ func (db *DB) exists(tx *bbolt.Tx, addr oid.Address, currEpoch uint64) (exists b // check graveyard and object expiration first switch objectStatus(tx, addr, currEpoch) { case 1: - return false, logicerr.Wrap(apistatus.ObjectNotFound{}) + return false, logicerr.Wrap(apistatus.NewObjectNotFound()) case 2: - return false, logicerr.Wrap(apistatus.ObjectAlreadyRemoved{}) + return false, logicerr.Wrap(apistatus.NewObjectAlreadyRemoved()) case 3: return false, ErrObjectIsExpired } diff --git a/pkg/local_object_storage/metabase/get.go b/pkg/local_object_storage/metabase/get.go index ad35b4c18..72ca32a8d 100644 --- a/pkg/local_object_storage/metabase/get.go +++ b/pkg/local_object_storage/metabase/get.go @@ -91,9 +91,9 @@ func (db *DB) get(tx *bbolt.Tx, addr oid.Address, key []byte, checkStatus, raw b if checkStatus { switch objectStatus(tx, addr, currEpoch) { case 1: - return nil, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, logicerr.Wrap(apistatus.NewObjectNotFound()) case 2: - return nil, logicerr.Wrap(apistatus.ObjectAlreadyRemoved{}) + return nil, logicerr.Wrap(apistatus.NewObjectAlreadyRemoved()) case 3: return nil, ErrObjectIsExpired } @@ -143,7 +143,7 @@ func getVirtualObject(tx *bbolt.Tx, cnr cid.ID, key []byte, raw bool) (*objectSD bucketName := make([]byte, bucketKeySize) parentBucket := tx.Bucket(parentBucketName(cnr, bucketName)) if parentBucket == nil { - return nil, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, logicerr.Wrap(apistatus.NewObjectNotFound()) } relativeLst, err := decodeList(parentBucket.Get(key)) @@ -152,7 +152,7 @@ func getVirtualObject(tx *bbolt.Tx, cnr cid.ID, key []byte, raw bool) (*objectSD } if len(relativeLst) == 0 { // this should never happen though - return nil, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, logicerr.Wrap(apistatus.NewObjectNotFound()) } // pick last item, for now there is not difference which address to pick @@ -171,7 +171,7 @@ func getVirtualObject(tx *bbolt.Tx, cnr cid.ID, key []byte, raw bool) (*objectSD par := child.Parent() if par == nil { // this should never happen though - return nil, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, logicerr.Wrap(apistatus.NewObjectNotFound()) } return par, nil @@ -183,5 +183,5 @@ func getSplitInfoError(tx *bbolt.Tx, cnr cid.ID, key []byte) error { return logicerr.Wrap(objectSDK.NewSplitInfoError(splitInfo)) } - return logicerr.Wrap(apistatus.ObjectNotFound{}) + return logicerr.Wrap(apistatus.NewObjectNotFound()) } diff --git a/pkg/local_object_storage/metabase/inhume.go b/pkg/local_object_storage/metabase/inhume.go index 7ba5a68a2..5f1cf00e5 100644 --- a/pkg/local_object_storage/metabase/inhume.go +++ b/pkg/local_object_storage/metabase/inhume.go @@ -166,7 +166,7 @@ func (db *DB) inhumeTx(tx *bbolt.Tx, epoch uint64, prm InhumePrm, res *InhumeRes // prevent locked objects to be inhumed if !prm.forceRemoval && objectLocked(tx, cnr, id) { - return apistatus.ObjectLocked{} + return apistatus.NewObjectLocked() } var lockWasChecked bool diff --git a/pkg/local_object_storage/metabase/inhume_test.go b/pkg/local_object_storage/metabase/inhume_test.go index 0f0774227..f322a1eae 100644 --- a/pkg/local_object_storage/metabase/inhume_test.go +++ b/pkg/local_object_storage/metabase/inhume_test.go @@ -109,7 +109,7 @@ func TestInhumeLocked(t *testing.T) { _, err = db.Inhume(context.Background(), prm) - var e apistatus.ObjectLocked + e := apistatus.NewObjectLocked() require.ErrorAs(t, err, &e) } diff --git a/pkg/local_object_storage/metabase/lock.go b/pkg/local_object_storage/metabase/lock.go index 50aac223b..c96f4219d 100644 --- a/pkg/local_object_storage/metabase/lock.go +++ b/pkg/local_object_storage/metabase/lock.go @@ -80,7 +80,7 @@ func (db *DB) lockInternal(locked []oid.ID, cnr cid.ID, locker oid.ID) error { return metaerr.Wrap(db.boltDB.Update(func(tx *bbolt.Tx) error { if firstIrregularObjectType(tx, cnr, bucketKeysLocked...) != objectSDK.TypeRegular { - return logicerr.Wrap(apistatus.LockNonRegularObject{}) + return logicerr.Wrap(apistatus.NewLockNonRegularObject()) } bucketLocked := tx.Bucket(bucketNameLocked) diff --git a/pkg/local_object_storage/metabase/put.go b/pkg/local_object_storage/metabase/put.go index 7a24485b3..0593f1858 100644 --- a/pkg/local_object_storage/metabase/put.go +++ b/pkg/local_object_storage/metabase/put.go @@ -344,10 +344,10 @@ func updateFKBTIndexes(tx *bbolt.Tx, obj *objectSDK.Object, f updateIndexItemFun // user specified attributes for i := range attrs { - key = attributeBucketName(cnr, attrs[i].Key(), key) + key = attributeBucketName(cnr, attrs[i].GetKey(), key) err := f(tx, namedBucketItem{ name: key, - key: []byte(attrs[i].Value()), + key: []byte(attrs[i].GetValue()), val: objKey, }) if err != nil { diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index 6a7acd7cc..fc2a19331 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -8,7 +8,8 @@ import ( "strings" "time" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/metaerr" "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing" @@ -193,27 +194,27 @@ func (db *DB) selectFastFilter( currEpoch := db.epochState.CurrentEpoch() bucketName := make([]byte, bucketKeySize) switch f.Header() { - case v2object.FilterHeaderObjectID: + case objectapi.FilterHeaderObjectID: db.selectObjectID(tx, f, cnr, to, fNum, currEpoch) - case v2object.FilterHeaderOwnerID: + case objectapi.FilterHeaderOwnerID: bucketName := ownerBucketName(cnr, bucketName) db.selectFromFKBT(tx, bucketName, f, to, fNum) - case v2object.FilterHeaderPayloadHash: + case objectapi.FilterHeaderPayloadHash: bucketName := payloadHashBucketName(cnr, bucketName) db.selectFromList(tx, bucketName, f, to, fNum) - case v2object.FilterHeaderObjectType: + case objectapi.FilterHeaderObjectType: for _, bucketName := range bucketNamesForType(cnr, f.Operation(), f.Value()) { selectAllFromBucket(tx, bucketName, to, fNum) } - case v2object.FilterHeaderParent: + case objectapi.FilterHeaderParent: bucketName := parentBucketName(cnr, bucketName) db.selectFromList(tx, bucketName, f, to, fNum) - case v2object.FilterHeaderSplitID: + case objectapi.FilterHeaderSplitID: bucketName := splitBucketName(cnr, bucketName) db.selectFromList(tx, bucketName, f, to, fNum) - case v2object.FilterPropertyRoot: + case objectapi.FilterPropertyRoot: selectAllFromBucket(tx, rootBucketName(cnr, bucketName), to, fNum) - case v2object.FilterPropertyPhy: + case objectapi.FilterPropertyPhy: selectAllFromBucket(tx, primaryBucketName(cnr, bucketName), to, fNum) selectAllFromBucket(tx, tombstoneBucketName(cnr, bucketName), to, fNum) selectAllFromBucket(tx, bucketNameLockers(cnr, bucketName), to, fNum) @@ -229,9 +230,9 @@ func (db *DB) selectFastFilter( } var mBucketNaming = map[string][]func(cid.ID, []byte) []byte{ - v2object.TypeRegular.String(): {primaryBucketName, parentBucketName}, - v2object.TypeTombstone.String(): {tombstoneBucketName}, - v2object.TypeLock.String(): {bucketNameLockers}, + objectGRPC.ObjectType_REGULAR.String(): {primaryBucketName, parentBucketName}, + objectGRPC.ObjectType_TOMBSTONE.String(): {tombstoneBucketName}, + objectGRPC.ObjectType_LOCK.String(): {bucketNameLockers}, } func allBucketNames(cnr cid.ID) (names [][]byte) { @@ -495,15 +496,15 @@ func (db *DB) matchSlowFilters(tx *bbolt.Tx, addr oid.Address, f objectSDK.Searc var data []byte switch f[i].Header() { - case v2object.FilterHeaderVersion: + case objectapi.FilterHeaderVersion: data = []byte(obj.Version().String()) - case v2object.FilterHeaderHomomorphicHash: + case objectapi.FilterHeaderHomomorphicHash: cs, _ := obj.PayloadHomomorphicHash() data = cs.Value() - case v2object.FilterHeaderCreationEpoch: + case objectapi.FilterHeaderCreationEpoch: data = make([]byte, 8) binary.LittleEndian.PutUint64(data, obj.CreationEpoch()) - case v2object.FilterHeaderPayloadLength: + case objectapi.FilterHeaderPayloadLength: data = make([]byte, 8) binary.LittleEndian.PutUint64(data, obj.PayloadSize()) default: @@ -529,7 +530,7 @@ func groupFilters(filters objectSDK.SearchFilters) (filterGroup, error) { for i := range filters { switch filters[i].Header() { - case v2object.FilterHeaderContainerID: // support deprecated field + case objectapi.FilterHeaderContainerID: // support deprecated field err := res.cnr.DecodeString(filters[i].Value()) if err != nil { return filterGroup{}, fmt.Errorf("can't parse container id: %w", err) @@ -537,10 +538,10 @@ func groupFilters(filters objectSDK.SearchFilters) (filterGroup, error) { res.withCnrFilter = true case // slow filters - v2object.FilterHeaderVersion, - v2object.FilterHeaderCreationEpoch, - v2object.FilterHeaderPayloadLength, - v2object.FilterHeaderHomomorphicHash: + objectapi.FilterHeaderVersion, + objectapi.FilterHeaderCreationEpoch, + objectapi.FilterHeaderPayloadLength, + objectapi.FilterHeaderHomomorphicHash: res.slowFilters = append(res.slowFilters, filters[i]) default: // fast filters or user attributes if unknown res.fastFilters = append(res.fastFilters, filters[i]) @@ -569,5 +570,6 @@ func checkNonEmpty(fs objectSDK.SearchFilters) bool { // returns true if string key is a reserved system filter key. func isSystemKey(key string) bool { - return strings.HasPrefix(key, v2object.ReservedFilterPrefix) + // FIXME: #1147 version-dependent approach + return strings.HasPrefix(key, objectapi.ReservedFilterPrefix) } diff --git a/pkg/local_object_storage/metabase/select_test.go b/pkg/local_object_storage/metabase/select_test.go index e107085ab..ebd13b7cf 100644 --- a/pkg/local_object_storage/metabase/select_test.go +++ b/pkg/local_object_storage/metabase/select_test.go @@ -6,7 +6,8 @@ import ( "strconv" "testing" - v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil" meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase" @@ -199,7 +200,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) { ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterPropertyRoot, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterPropertyRoot, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) @@ -216,13 +217,13 @@ func TestDB_SelectRootPhyParent(t *testing.T) { ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterPropertyPhy, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterPropertyPhy, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) t.Run("regular objects", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeRegular.String(), objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderObjectType, objectGRPC.ObjectType_REGULAR.String(), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(small), object.AddressOf(leftChild), @@ -232,24 +233,24 @@ func TestDB_SelectRootPhyParent(t *testing.T) { ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeRegular.String(), objectSDK.MatchStringNotEqual) + fs.AddFilter(objectapi.FilterHeaderObjectType, objectGRPC.ObjectType_REGULAR.String(), objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(ts), object.AddressOf(lock), ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderObjectType, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) t.Run("tombstone objects", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeTombstone.String(), objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderObjectType, objectGRPC.ObjectType_TOMBSTONE.String(), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(ts)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeTombstone.String(), objectSDK.MatchStringNotEqual) + fs.AddFilter(objectapi.FilterHeaderObjectType, objectGRPC.ObjectType_TOMBSTONE.String(), objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(small), object.AddressOf(leftChild), @@ -260,7 +261,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) { ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderObjectType, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderObjectType, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) @@ -268,7 +269,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) { idParent, _ := parent.ID() fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderParent, + fs.AddFilter(objectapi.FilterHeaderParent, idParent.EncodeToString(), objectSDK.MatchStringEqual) @@ -278,7 +279,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) { ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderParent, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderParent, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) @@ -349,28 +350,28 @@ func TestDB_SelectPayloadHash(t *testing.T) { payloadHash := hex.EncodeToString(cs.Value()) fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash, objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash[:len(payloadHash)-1], objectSDK.MatchCommonPrefix) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash, objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw2)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, "", objectSDK.MatchNotPresent) @@ -378,21 +379,21 @@ func TestDB_SelectPayloadHash(t *testing.T) { t.Run("invalid hashes", func(t *testing.T) { fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash[:len(payloadHash)-1], objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw1), object.AddressOf(raw2)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash[:len(payloadHash)-2]+"x", objectSDK.MatchCommonPrefix) testSelect(t, db, cnr, fs) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadHash, + fs.AddFilter(objectapi.FilterHeaderPayloadHash, payloadHash[:len(payloadHash)-3]+"x0", objectSDK.MatchCommonPrefix) @@ -407,10 +408,10 @@ func TestDB_SelectWithSlowFilters(t *testing.T) { cnr := cidtest.ID() - v20 := new(version.Version) + v20 := version.NewVersion() v20.SetMajor(2) - var v21 version.Version + v21 := version.NewVersion() v21.SetMajor(2) v21.SetMinor(1) @@ -424,7 +425,7 @@ func TestDB_SelectWithSlowFilters(t *testing.T) { raw2 := testutil.GenerateObjectWithCID(cnr) raw2.SetPayloadSize(20) raw2.SetCreationEpoch(21) - raw2.SetVersion(&v21) + raw2.SetVersion(v21) err = putBig(db, raw2) require.NoError(t, err) @@ -432,21 +433,21 @@ func TestDB_SelectWithSlowFilters(t *testing.T) { cs, _ := raw1.PayloadHomomorphicHash() fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderHomomorphicHash, + fs.AddFilter(objectapi.FilterHeaderHomomorphicHash, hex.EncodeToString(cs.Value()), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderHomomorphicHash, + fs.AddFilter(objectapi.FilterHeaderHomomorphicHash, hex.EncodeToString(cs.Value()), objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw2)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderHomomorphicHash, + fs.AddFilter(objectapi.FilterHeaderHomomorphicHash, "", objectSDK.MatchNotPresent) @@ -455,39 +456,39 @@ func TestDB_SelectWithSlowFilters(t *testing.T) { t.Run("object with payload length", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadLength, "20", objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderPayloadLength, "20", objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw2)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadLength, "20", objectSDK.MatchStringNotEqual) + fs.AddFilter(objectapi.FilterHeaderPayloadLength, "20", objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderPayloadLength, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderPayloadLength, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) t.Run("object with creation epoch", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderCreationEpoch, "11", objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderCreationEpoch, "11", objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderCreationEpoch, "11", objectSDK.MatchStringNotEqual) + fs.AddFilter(objectapi.FilterHeaderCreationEpoch, "11", objectSDK.MatchStringNotEqual) testSelect(t, db, cnr, fs, object.AddressOf(raw2)) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderCreationEpoch, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderCreationEpoch, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderCreationEpoch, "1", objectSDK.MatchCommonPrefix) + fs.AddFilter(objectapi.FilterHeaderCreationEpoch, "1", objectSDK.MatchCommonPrefix) testSelect(t, db, cnr, fs, object.AddressOf(raw1)) }) @@ -646,32 +647,32 @@ func TestDB_SelectSplitID(t *testing.T) { t.Run("not present", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderSplitID, "", objectSDK.MatchNotPresent) + fs.AddFilter(objectapi.FilterHeaderSplitID, "", objectSDK.MatchNotPresent) testSelect(t, db, cnr, fs) }) t.Run("split id", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderSplitID, split1.String(), objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderSplitID, split1.String(), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(child1), object.AddressOf(child2), ) fs = objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderSplitID, split2.String(), objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderSplitID, split2.String(), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs, object.AddressOf(child3)) }) t.Run("empty split", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderSplitID, "", objectSDK.MatchStringEqual) + fs.AddFilter(objectapi.FilterHeaderSplitID, "", objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs) }) t.Run("unknown split id", func(t *testing.T) { fs := objectSDK.SearchFilters{} - fs.AddFilter(v2object.FilterHeaderSplitID, + fs.AddFilter(objectapi.FilterHeaderSplitID, objectSDK.NewSplitID().String(), objectSDK.MatchStringEqual) testSelect(t, db, cnr, fs) @@ -732,7 +733,7 @@ func BenchmarkSelect(b *testing.B) { cid := cidtest.ID() for i := 0; i < objCount; i++ { - var attr objectSDK.Attribute + attr := *objectSDK.NewAttribute() attr.SetKey("myHeader") attr.SetValue(strconv.Itoa(i)) obj := testutil.GenerateObjectWithCID(cid) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index db8248c02..2255ebead 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -214,7 +214,7 @@ func (s *Shard) refillMetabase(ctx context.Context) error { } func (s *Shard) refillLockObject(ctx context.Context, obj *objectSDK.Object) error { - var lock objectSDK.Lock + lock := *objectSDK.NewLock() if err := lock.Unmarshal(obj.Payload()); err != nil { return fmt.Errorf("could not unmarshal lock content: %w", err) } diff --git a/pkg/local_object_storage/shard/control_test.go b/pkg/local_object_storage/shard/control_test.go index 82b107196..ff4cbe3a5 100644 --- a/pkg/local_object_storage/shard/control_test.go +++ b/pkg/local_object_storage/shard/control_test.go @@ -262,7 +262,7 @@ func TestRefillMetabase(t *testing.T) { require.NoError(t, err) // LOCK object handling - var lock objectSDK.Lock + lock := *objectSDK.NewLock() lock.WriteMembers(locked) lockObj := objecttest.Object() @@ -295,7 +295,7 @@ func TestRefillMetabase(t *testing.T) { } require.NoError(t, err) - require.Equal(t, expObj.CutPayload(), res.Object()) + require.True(t, expObj.CutPayload().Equal(res.Object())) } checkAllObjs := func(exists bool) { diff --git a/pkg/local_object_storage/shard/gc_test.go b/pkg/local_object_storage/shard/gc_test.go index 263a0ea4d..4045a09b8 100644 --- a/pkg/local_object_storage/shard/gc_test.go +++ b/pkg/local_object_storage/shard/gc_test.go @@ -33,7 +33,7 @@ func Test_GCDropsLockedExpiredSimpleObject(t *testing.T) { cnr := cidtest.ID() - var objExpirationAttr objectSDK.Attribute + objExpirationAttr := *objectSDK.NewAttribute() objExpirationAttr.SetKey(objectV2.SysAttributeExpEpoch) objExpirationAttr.SetValue("101") @@ -41,7 +41,7 @@ func Test_GCDropsLockedExpiredSimpleObject(t *testing.T) { obj.SetAttributes(objExpirationAttr) objID, _ := obj.ID() - var lockExpirationAttr objectSDK.Attribute + lockExpirationAttr := *objectSDK.NewAttribute() lockExpirationAttr.SetKey(objectV2.SysAttributeExpEpoch) lockExpirationAttr.SetValue("103") @@ -85,11 +85,11 @@ func Test_GCDropsLockedExpiredComplexObject(t *testing.T) { parentID := oidtest.ID() splitID := objectSDK.NewSplitID() - var objExpirationAttr objectSDK.Attribute + objExpirationAttr := *objectSDK.NewAttribute() objExpirationAttr.SetKey(objectV2.SysAttributeExpEpoch) objExpirationAttr.SetValue("101") - var lockExpirationAttr objectSDK.Attribute + lockExpirationAttr := *objectSDK.NewAttribute() lockExpirationAttr.SetKey(objectV2.SysAttributeExpEpoch) lockExpirationAttr.SetValue("103") diff --git a/pkg/local_object_storage/shard/get.go b/pkg/local_object_storage/shard/get.go index 3eb70784e..d2a1e1a7d 100644 --- a/pkg/local_object_storage/shard/get.go +++ b/pkg/local_object_storage/shard/get.go @@ -129,7 +129,7 @@ func (s *Shard) fetchObjectData(ctx context.Context, addr oid.Address, skipMeta } if !mRes.Exists() { - return nil, false, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, false, logicerr.Wrap(apistatus.NewObjectNotFound()) } } else { s.log.Warn(logs.ShardFetchingObjectWithoutMeta, zap.Stringer("addr", addr)) diff --git a/pkg/local_object_storage/shard/get_test.go b/pkg/local_object_storage/shard/get_test.go index 2db86c48a..bd3602765 100644 --- a/pkg/local_object_storage/shard/get_test.go +++ b/pkg/local_object_storage/shard/get_test.go @@ -51,7 +51,7 @@ func testShardGet(t *testing.T, hasWriteCache bool) { res, err := testGet(t, sh, getPrm, hasWriteCache) require.NoError(t, err) - require.Equal(t, obj, res.Object()) + require.True(t, obj.Equal(res.Object())) }) t.Run("big object", func(t *testing.T) { @@ -69,7 +69,7 @@ func testShardGet(t *testing.T, hasWriteCache bool) { res, err := testGet(t, sh, getPrm, hasWriteCache) require.NoError(t, err) - require.Equal(t, obj, res.Object()) + require.True(t, obj.Equal(res.Object())) }) t.Run("parent object", func(t *testing.T) { diff --git a/pkg/local_object_storage/shard/range.go b/pkg/local_object_storage/shard/range.go index e94482e36..2bebbdb73 100644 --- a/pkg/local_object_storage/shard/range.go +++ b/pkg/local_object_storage/shard/range.go @@ -94,6 +94,7 @@ func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) { cb := func(stor *blobstor.BlobStor, id []byte) (*objectSDK.Object, error) { var getRngPrm common.GetRangePrm getRngPrm.Address = prm.addr + getRngPrm.Range = *objectSDK.NewRange() getRngPrm.Range.SetOffset(prm.off) getRngPrm.Range.SetLength(prm.ln) getRngPrm.StorageID = id @@ -119,7 +120,7 @@ func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) { from := prm.off to := from + prm.ln if pLen := uint64(len(payload)); to < from || pLen < from || pLen < to { - return nil, logicerr.Wrap(apistatus.ObjectOutOfRange{}) + return nil, logicerr.Wrap(apistatus.NewObjectOutOfRange()) } obj := objectSDK.New() diff --git a/pkg/local_object_storage/shard/reload_test.go b/pkg/local_object_storage/shard/reload_test.go index 0b964ba2e..ed1e09f3f 100644 --- a/pkg/local_object_storage/shard/reload_test.go +++ b/pkg/local_object_storage/shard/reload_test.go @@ -150,7 +150,7 @@ func newObject() *objectSDK.Object { x.SetOwnerID(usertest.ID()) x.SetContainerID(cidtest.ID()) x.SetType(objectSDK.TypeRegular) - x.SetVersion(&ver) + x.SetVersion(ver) x.SetPayloadChecksum(checksumtest.Checksum()) x.SetPayloadHomomorphicHash(checksumtest.Checksum()) return x diff --git a/pkg/local_object_storage/writecache/flush.go b/pkg/local_object_storage/writecache/flush.go index 779bac39a..18adf58b4 100644 --- a/pkg/local_object_storage/writecache/flush.go +++ b/pkg/local_object_storage/writecache/flush.go @@ -201,7 +201,7 @@ func (c *cache) flushFSTree(ctx context.Context, ignoreErrors bool) error { return err } - var obj objectSDK.Object + obj := objectSDK.New() err = obj.Unmarshal(data) if err != nil { c.reportFlushError("can't unmarshal an object", sAddr, metaerr.Wrap(err)) @@ -211,7 +211,7 @@ func (c *cache) flushFSTree(ctx context.Context, ignoreErrors bool) error { return err } - err = c.flushObject(ctx, &obj, data, StorageTypeFSTree) + err = c.flushObject(ctx, obj, data, StorageTypeFSTree) if err != nil { if ignoreErrors { return nil @@ -322,7 +322,7 @@ func (c *cache) flush(ctx context.Context, ignoreErrors bool) error { return err } - var obj objectSDK.Object + obj := objectSDK.New() if err := obj.Unmarshal(data); err != nil { c.reportFlushError("can't unmarshal an object from the DB", sa, metaerr.Wrap(err)) if ignoreErrors { @@ -331,7 +331,7 @@ func (c *cache) flush(ctx context.Context, ignoreErrors bool) error { return err } - if err := c.flushObject(ctx, &obj, data, StorageTypeDB); err != nil { + if err := c.flushObject(ctx, obj, data, StorageTypeDB); err != nil { return err } } diff --git a/pkg/local_object_storage/writecache/flush_test.go b/pkg/local_object_storage/writecache/flush_test.go index 2223bef02..2e875d231 100644 --- a/pkg/local_object_storage/writecache/flush_test.go +++ b/pkg/local_object_storage/writecache/flush_test.go @@ -96,7 +96,7 @@ func TestFlush(t *testing.T) { res, err := bs.Get(context.Background(), prm) require.NoError(t, err) - require.Equal(t, objects[i].obj, res.Object) + require.True(t, objects[i].obj.Equal(res.Object)) } } @@ -219,7 +219,7 @@ func newObject(t *testing.T, size int) (*objectSDK.Object, []byte) { obj.SetOwnerID(usertest.ID()) obj.SetContainerID(cidtest.ID()) obj.SetType(objectSDK.TypeRegular) - obj.SetVersion(&ver) + obj.SetVersion(ver) obj.SetPayloadChecksum(checksumtest.Checksum()) obj.SetPayloadHomomorphicHash(checksumtest.Checksum()) obj.SetPayload(make([]byte, size)) diff --git a/pkg/local_object_storage/writecache/get.go b/pkg/local_object_storage/writecache/get.go index 2546bada9..752e287cb 100644 --- a/pkg/local_object_storage/writecache/get.go +++ b/pkg/local_object_storage/writecache/get.go @@ -51,7 +51,7 @@ func (c *cache) getInternal(ctx context.Context, saddr string, addr oid.Address) res, err := c.fsTree.Get(ctx, common.GetPrm{Address: addr}) if err != nil { - return nil, logicerr.Wrap(apistatus.ObjectNotFound{}) + return nil, logicerr.Wrap(apistatus.NewObjectNotFound()) } found = true @@ -92,7 +92,7 @@ func Get(db *bbolt.DB, key []byte) ([]byte, error) { } value = b.Get(key) if value == nil { - return logicerr.Wrap(apistatus.ObjectNotFound{}) + return logicerr.Wrap(apistatus.NewObjectNotFound()) } value = slice.Copy(value) return nil diff --git a/pkg/morph/client/container/eacl.go b/pkg/morph/client/container/eacl.go index 54c83737d..0c54067ed 100644 --- a/pkg/morph/client/container/eacl.go +++ b/pkg/morph/client/container/eacl.go @@ -4,7 +4,7 @@ import ( "crypto/sha256" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" @@ -55,7 +55,7 @@ func (c *Client) GetEACL(cnr cid.ID) (*container.EACL, error) { // The absence of a signature in the response can be taken as an eACL absence criterion, // since unsigned table cannot be approved in the storage by design. if len(sig) == 0 { - var errEACLNotFound apistatus.EACLNotFound + errEACLNotFound := apistatus.NewEACLNotFound() return nil, errEACLNotFound } @@ -86,12 +86,12 @@ func (c *Client) GetEACL(cnr cid.ID) (*container.EACL, error) { } } - // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + var sigV2 refsGRPC.Signature sigV2.SetKey(pub) sigV2.SetSign(sig) - sigV2.SetScheme(refs.ECDSA_RFC6979_SHA256) + sigV2.SetScheme(refsGRPC.SignatureScheme_ECDSA_RFC6979_SHA256) - err = res.Signature.ReadFromV2(sigV2) + err = res.Signature.ReadFromV2(&sigV2) return &res, err } diff --git a/pkg/morph/client/container/eacl_set.go b/pkg/morph/client/container/eacl_set.go index 2d2ffb456..2d3bd069e 100644 --- a/pkg/morph/client/container/eacl_set.go +++ b/pkg/morph/client/container/eacl_set.go @@ -3,7 +3,7 @@ package container import ( "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" ) @@ -31,8 +31,8 @@ func PutEACL(c *Client, eaclInfo containercore.EACL) error { prm.SetToken(eaclInfo.Session.Marshal()) } - // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + var sigV2 refsGRPC.Signature eaclInfo.Signature.WriteToV2(&sigV2) prm.SetKey(sigV2.GetKey()) diff --git a/pkg/morph/client/container/get.go b/pkg/morph/client/container/get.go index 0513eea4b..732001b60 100644 --- a/pkg/morph/client/container/get.go +++ b/pkg/morph/client/container/get.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" containerContract "git.frostfs.info/TrueCloudLab/frostfs-contract/container" containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" @@ -51,7 +51,7 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) { res, err := c.client.TestInvoke(prm) if err != nil { if strings.Contains(err.Error(), containerContract.NotFoundError) { - var errNotFound apistatus.ContainerNotFound + errNotFound := apistatus.NewContainerNotFound() return nil, errNotFound } @@ -105,12 +105,12 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) { } } - // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + var sigV2 refsGRPC.Signature sigV2.SetKey(pub) sigV2.SetSign(sigBytes) - sigV2.SetScheme(refs.ECDSA_RFC6979_SHA256) + sigV2.SetScheme(refsGRPC.SignatureScheme_ECDSA_RFC6979_SHA256) - err = cnr.Signature.ReadFromV2(sigV2) + err = cnr.Signature.ReadFromV2(&sigV2) return &cnr, err } diff --git a/pkg/morph/client/container/load.go b/pkg/morph/client/container/load.go index dcf89f73e..1af411f9c 100644 --- a/pkg/morph/client/container/load.go +++ b/pkg/morph/client/container/load.go @@ -4,7 +4,7 @@ import ( "crypto/sha256" "fmt" - v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + v2refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/pkg/morph/client/container/put.go b/pkg/morph/client/container/put.go index 5c23eb36d..97c4e44da 100644 --- a/pkg/morph/client/container/put.go +++ b/pkg/morph/client/container/put.go @@ -3,7 +3,7 @@ package container import ( "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" @@ -28,8 +28,8 @@ func Put(c *Client, cnr containercore.Container) (*cid.ID, error) { prm.SetToken(cnr.Session.Marshal()) } - // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + var sigV2 refsGRPC.Signature cnr.Signature.WriteToV2(&sigV2) prm.SetKey(sigV2.GetKey()) diff --git a/pkg/morph/client/netmap/client.go b/pkg/morph/client/netmap/client.go index eafa097e9..fa8eb455a 100644 --- a/pkg/morph/client/netmap/client.go +++ b/pkg/morph/client/netmap/client.go @@ -11,6 +11,10 @@ import ( type NodeInfo = netmap.NodeInfo +func NewNodeInfo() NodeInfo { + return NodeInfo(netmap.NewNodeInfo()) +} + // Client is a wrapper over StaticClient // which makes calls with the names and arguments // of the FrostFS Netmap contract. diff --git a/pkg/morph/client/netmap/netmap_test.go b/pkg/morph/client/netmap/netmap_test.go index d6172a682..c28517f3a 100644 --- a/pkg/morph/client/netmap/netmap_test.go +++ b/pkg/morph/client/netmap/netmap_test.go @@ -15,6 +15,7 @@ import ( func Test_stackItemsToNodeInfos(t *testing.T) { expected := make([]netmap.NodeInfo, 4) for i := range expected { + expected[i] = netmap.NewNodeInfo() pub := make([]byte, 33) rand.Read(pub) diff --git a/pkg/network/transport/accounting/grpc/service.go b/pkg/network/transport/accounting/grpc/service.go index 2144a3001..5b8e69e2e 100644 --- a/pkg/network/transport/accounting/grpc/service.go +++ b/pkg/network/transport/accounting/grpc/service.go @@ -3,7 +3,6 @@ package accounting import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" accountingGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" accountingsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/accounting" ) @@ -23,15 +22,5 @@ func New(c accountingsvc.Server) *Server { // Balance converts gRPC BalanceRequest message and passes it to internal Accounting service. func (s *Server) Balance(ctx context.Context, req *accountingGRPC.BalanceRequest) (*accountingGRPC.BalanceResponse, error) { - balReq := new(accounting.BalanceRequest) - if err := balReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Balance(ctx, balReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*accountingGRPC.BalanceResponse), nil + return s.srv.Balance(ctx, req) } diff --git a/pkg/network/transport/container/grpc/service.go b/pkg/network/transport/container/grpc/service.go index ed514d6d4..065ced859 100644 --- a/pkg/network/transport/container/grpc/service.go +++ b/pkg/network/transport/container/grpc/service.go @@ -3,7 +3,6 @@ package container import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" containersvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/container" ) @@ -23,105 +22,35 @@ func New(c containersvc.Server) *Server { // Put converts gRPC PutRequest message and passes it to internal Container service. func (s *Server) Put(ctx context.Context, req *containerGRPC.PutRequest) (*containerGRPC.PutResponse, error) { - putReq := new(container.PutRequest) - if err := putReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Put(ctx, putReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.PutResponse), nil + return s.srv.Put(ctx, req) } // Delete converts gRPC DeleteRequest message and passes it to internal Container service. func (s *Server) Delete(ctx context.Context, req *containerGRPC.DeleteRequest) (*containerGRPC.DeleteResponse, error) { - delReq := new(container.DeleteRequest) - if err := delReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Delete(ctx, delReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.DeleteResponse), nil + return s.srv.Delete(ctx, req) } // Get converts gRPC GetRequest message and passes it to internal Container service. func (s *Server) Get(ctx context.Context, req *containerGRPC.GetRequest) (*containerGRPC.GetResponse, error) { - getReq := new(container.GetRequest) - if err := getReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Get(ctx, getReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.GetResponse), nil + return s.srv.Get(ctx, req) } // List converts gRPC ListRequest message and passes it to internal Container service. func (s *Server) List(ctx context.Context, req *containerGRPC.ListRequest) (*containerGRPC.ListResponse, error) { - listReq := new(container.ListRequest) - if err := listReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.List(ctx, listReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.ListResponse), nil + return s.srv.List(ctx, req) } // SetExtendedACL converts gRPC SetExtendedACLRequest message and passes it to internal Container service. func (s *Server) SetExtendedACL(ctx context.Context, req *containerGRPC.SetExtendedACLRequest) (*containerGRPC.SetExtendedACLResponse, error) { - setEACLReq := new(container.SetExtendedACLRequest) - if err := setEACLReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.SetExtendedACL(ctx, setEACLReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.SetExtendedACLResponse), nil + return s.srv.SetExtendedACL(ctx, req) } // GetExtendedACL converts gRPC GetExtendedACLRequest message and passes it to internal Container service. func (s *Server) GetExtendedACL(ctx context.Context, req *containerGRPC.GetExtendedACLRequest) (*containerGRPC.GetExtendedACLResponse, error) { - getEACLReq := new(container.GetExtendedACLRequest) - if err := getEACLReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.GetExtendedACL(ctx, getEACLReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.GetExtendedACLResponse), nil + return s.srv.GetExtendedACL(ctx, req) } // AnnounceUsedSpace converts gRPC AnnounceUsedSpaceRequest message and passes it to internal Container service. func (s *Server) AnnounceUsedSpace(ctx context.Context, req *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) { - announceReq := new(container.AnnounceUsedSpaceRequest) - if err := announceReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.AnnounceUsedSpace(ctx, announceReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*containerGRPC.AnnounceUsedSpaceResponse), nil + return s.srv.AnnounceUsedSpace(ctx, req) } diff --git a/pkg/network/transport/netmap/grpc/service.go b/pkg/network/transport/netmap/grpc/service.go index 7a3aec86c..c2c54daa4 100644 --- a/pkg/network/transport/netmap/grpc/service.go +++ b/pkg/network/transport/netmap/grpc/service.go @@ -3,7 +3,6 @@ package grpc import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" netmapsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/netmap" ) @@ -25,45 +24,15 @@ func New(c netmapsvc.Server) *Server { func (s *Server) LocalNodeInfo( ctx context.Context, req *netmapGRPC.LocalNodeInfoRequest) (*netmapGRPC.LocalNodeInfoResponse, error) { - nodeInfoReq := new(netmap.LocalNodeInfoRequest) - if err := nodeInfoReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.LocalNodeInfo(ctx, nodeInfoReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*netmapGRPC.LocalNodeInfoResponse), nil + return s.srv.LocalNodeInfo(ctx, req) } // NetworkInfo converts gRPC request message and passes it to internal netmap service. func (s *Server) NetworkInfo(ctx context.Context, req *netmapGRPC.NetworkInfoRequest) (*netmapGRPC.NetworkInfoResponse, error) { - netInfoReq := new(netmap.NetworkInfoRequest) - if err := netInfoReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.NetworkInfo(ctx, netInfoReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*netmapGRPC.NetworkInfoResponse), nil + return s.srv.NetworkInfo(ctx, req) } // NetmapSnapshot converts gRPC request message and passes it to internal netmap service. func (s *Server) NetmapSnapshot(ctx context.Context, req *netmapGRPC.NetmapSnapshotRequest) (*netmapGRPC.NetmapSnapshotResponse, error) { - snapshotReq := new(netmap.SnapshotRequest) - if err := snapshotReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Snapshot(ctx, snapshotReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*netmapGRPC.NetmapSnapshotResponse), nil + return s.srv.Snapshot(ctx, req) } diff --git a/pkg/network/transport/object/grpc/get.go b/pkg/network/transport/object/grpc/get.go index e1655c183..1eff5819a 100644 --- a/pkg/network/transport/object/grpc/get.go +++ b/pkg/network/transport/object/grpc/get.go @@ -1,7 +1,6 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" ) @@ -9,22 +8,15 @@ type getStreamerV2 struct { objectGRPC.ObjectService_GetServer } -func (s *getStreamerV2) Send(resp *object.GetResponse) error { - return s.ObjectService_GetServer.Send( - resp.ToGRPCMessage().(*objectGRPC.GetResponse), - ) +func (s *getStreamerV2) Send(resp *objectGRPC.GetResponse) error { + return s.ObjectService_GetServer.Send(resp) } // Get converts gRPC GetRequest message and server-side stream and overtakes its data // to gRPC stream. func (s *Server) Get(req *objectGRPC.GetRequest, gStream objectGRPC.ObjectService_GetServer) error { - getReq := new(object.GetRequest) - if err := getReq.FromGRPCMessage(req); err != nil { - return err - } - return s.srv.Get( - getReq, + req, &getStreamerV2{ ObjectService_GetServer: gStream, }, diff --git a/pkg/network/transport/object/grpc/range.go b/pkg/network/transport/object/grpc/range.go index 391536e8e..57b35cf2f 100644 --- a/pkg/network/transport/object/grpc/range.go +++ b/pkg/network/transport/object/grpc/range.go @@ -1,7 +1,6 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" ) @@ -9,22 +8,15 @@ type getRangeStreamerV2 struct { objectGRPC.ObjectService_GetRangeServer } -func (s *getRangeStreamerV2) Send(resp *object.GetRangeResponse) error { - return s.ObjectService_GetRangeServer.Send( - resp.ToGRPCMessage().(*objectGRPC.GetRangeResponse), - ) +func (s *getRangeStreamerV2) Send(resp *objectGRPC.GetRangeResponse) error { + return s.ObjectService_GetRangeServer.Send(resp) } // GetRange converts gRPC GetRangeRequest message and server-side stream and overtakes its data // to gRPC stream. func (s *Server) GetRange(req *objectGRPC.GetRangeRequest, gStream objectGRPC.ObjectService_GetRangeServer) error { - getRngReq := new(object.GetRangeRequest) - if err := getRngReq.FromGRPCMessage(req); err != nil { - return err - } - return s.srv.GetRange( - getRngReq, + req, &getRangeStreamerV2{ ObjectService_GetRangeServer: gStream, }, diff --git a/pkg/network/transport/object/grpc/search.go b/pkg/network/transport/object/grpc/search.go index a151ced09..707381c9f 100644 --- a/pkg/network/transport/object/grpc/search.go +++ b/pkg/network/transport/object/grpc/search.go @@ -1,7 +1,6 @@ package object import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" ) @@ -9,22 +8,15 @@ type searchStreamerV2 struct { objectGRPC.ObjectService_SearchServer } -func (s *searchStreamerV2) Send(resp *object.SearchResponse) error { - return s.ObjectService_SearchServer.Send( - resp.ToGRPCMessage().(*objectGRPC.SearchResponse), - ) +func (s *searchStreamerV2) Send(resp *objectGRPC.SearchResponse) error { + return s.ObjectService_SearchServer.Send(resp) } // Search converts gRPC SearchRequest message and server-side stream and overtakes its data // to gRPC stream. func (s *Server) Search(req *objectGRPC.SearchRequest, gStream objectGRPC.ObjectService_SearchServer) error { - searchReq := new(object.SearchRequest) - if err := searchReq.FromGRPCMessage(req); err != nil { - return err - } - return s.srv.Search( - searchReq, + req, &searchStreamerV2{ ObjectService_SearchServer: gStream, }, diff --git a/pkg/network/transport/object/grpc/service.go b/pkg/network/transport/object/grpc/service.go index 7c6b395d5..cae2c94de 100644 --- a/pkg/network/transport/object/grpc/service.go +++ b/pkg/network/transport/object/grpc/service.go @@ -5,7 +5,6 @@ import ( "errors" "io" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" @@ -40,25 +39,20 @@ func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error { return err } - return gStream.SendAndClose(resp.ToGRPCMessage().(*objectGRPC.PutResponse)) + return gStream.SendAndClose(resp) } return err } - putReq := new(object.PutRequest) - if err := putReq.FromGRPCMessage(req); err != nil { - return err - } - - if err := stream.Send(gStream.Context(), putReq); err != nil { + if err := stream.Send(gStream.Context(), req); err != nil { if errors.Is(err, util.ErrAbortStream) { resp, err := stream.CloseAndRecv(gStream.Context()) if err != nil { return err } - return gStream.SendAndClose(resp.ToGRPCMessage().(*objectGRPC.PutResponse)) + return gStream.SendAndClose(resp) } return err @@ -68,59 +62,19 @@ func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error { // Delete converts gRPC DeleteRequest message and passes it to internal Object service. func (s *Server) Delete(ctx context.Context, req *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) { - delReq := new(object.DeleteRequest) - if err := delReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Delete(ctx, delReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*objectGRPC.DeleteResponse), nil + return s.srv.Delete(ctx, req) } // Head converts gRPC HeadRequest message and passes it to internal Object service. func (s *Server) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { - searchReq := new(object.HeadRequest) - if err := searchReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Head(ctx, searchReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*objectGRPC.HeadResponse), nil + return s.srv.Head(ctx, req) } // GetRangeHash converts gRPC GetRangeHashRequest message and passes it to internal Object service. func (s *Server) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) { - hashRngReq := new(object.GetRangeHashRequest) - if err := hashRngReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.GetRangeHash(ctx, hashRngReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*objectGRPC.GetRangeHashResponse), nil + return s.srv.GetRangeHash(ctx, req) } func (s *Server) PutSingle(ctx context.Context, req *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { - putSingleReq := &object.PutSingleRequest{} - if err := putSingleReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.PutSingle(ctx, putSingleReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*objectGRPC.PutSingleResponse), nil + return s.srv.PutSingle(ctx, req) } diff --git a/pkg/network/transport/session/grpc/service.go b/pkg/network/transport/session/grpc/service.go index e0dc74942..f61b11150 100644 --- a/pkg/network/transport/session/grpc/service.go +++ b/pkg/network/transport/session/grpc/service.go @@ -3,7 +3,6 @@ package session import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" sessionsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/session" ) @@ -23,15 +22,5 @@ func New(c sessionsvc.Server) *Server { // Create converts gRPC CreateRequest message and passes it to internal Session service. func (s *Server) Create(ctx context.Context, req *sessionGRPC.CreateRequest) (*sessionGRPC.CreateResponse, error) { - createReq := new(session.CreateRequest) - if err := createReq.FromGRPCMessage(req); err != nil { - return nil, err - } - - resp, err := s.srv.Create(ctx, createReq) - if err != nil { - return nil, err - } - - return resp.ToGRPCMessage().(*sessionGRPC.CreateResponse), nil + return s.srv.Create(ctx, req) } diff --git a/pkg/network/validation_test.go b/pkg/network/validation_test.go index 7d3cb9577..263c70959 100644 --- a/pkg/network/validation_test.go +++ b/pkg/network/validation_test.go @@ -56,6 +56,7 @@ func TestVerifyMultiAddress_Order(t *testing.T) { } func constructNodeInfo(address string) (ni netmap.NodeInfo) { + ni = netmap.NewNodeInfo() ni.SetNetworkEndpoints(address) return ni } diff --git a/pkg/services/accounting/executor.go b/pkg/services/accounting/executor.go index b0722cf8a..a72ec55da 100644 --- a/pkg/services/accounting/executor.go +++ b/pkg/services/accounting/executor.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + accGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response" ) type ServiceExecutor interface { - Balance(context.Context, *accounting.BalanceRequestBody) (*accounting.BalanceResponseBody, error) + Balance(context.Context, *accGRPC.BalanceRequest_Body) (*accGRPC.BalanceResponse_Body, error) } type executorSvc struct { @@ -25,13 +25,13 @@ func NewExecutionService(exec ServiceExecutor, respSvc *response.Service) Server } } -func (s *executorSvc) Balance(ctx context.Context, req *accounting.BalanceRequest) (*accounting.BalanceResponse, error) { +func (s *executorSvc) Balance(ctx context.Context, req *accGRPC.BalanceRequest) (*accGRPC.BalanceResponse, error) { respBody, err := s.exec.Balance(ctx, req.GetBody()) if err != nil { return nil, fmt.Errorf("could not execute Balance request: %w", err) } - resp := new(accounting.BalanceResponse) + resp := new(accGRPC.BalanceResponse) resp.SetBody(respBody) s.respSvc.SetMeta(resp) diff --git a/pkg/services/accounting/morph/executor.go b/pkg/services/accounting/morph/executor.go index ac836b71d..a1d418893 100644 --- a/pkg/services/accounting/morph/executor.go +++ b/pkg/services/accounting/morph/executor.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + accGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/balance" accountingSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/accounting" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" @@ -21,15 +21,15 @@ func NewExecutor(client *balance.Client) accountingSvc.ServiceExecutor { } } -func (s *morphExecutor) Balance(_ context.Context, body *accounting.BalanceRequestBody) (*accounting.BalanceResponseBody, error) { - idV2 := body.GetOwnerID() +func (s *morphExecutor) Balance(_ context.Context, body *accGRPC.BalanceRequest_Body) (*accGRPC.BalanceResponse_Body, error) { + idV2 := body.GetOwnerId() if idV2 == nil { return nil, errors.New("missing account") } var id user.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid account: %w", err) } @@ -44,11 +44,11 @@ func (s *morphExecutor) Balance(_ context.Context, body *accounting.BalanceReque return nil, err } - dec := new(accounting.Decimal) + dec := new(accGRPC.Decimal) dec.SetValue(amount.Int64()) dec.SetPrecision(balancePrecision) - res := new(accounting.BalanceResponseBody) + res := new(accGRPC.BalanceResponse_Body) res.SetBalance(dec) return res, nil diff --git a/pkg/services/accounting/server.go b/pkg/services/accounting/server.go index 72833c46c..8b35df7e0 100644 --- a/pkg/services/accounting/server.go +++ b/pkg/services/accounting/server.go @@ -3,10 +3,10 @@ package accounting import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + accGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" ) // Server is an interface of the FrostFS API Accounting service server. type Server interface { - Balance(context.Context, *accounting.BalanceRequest) (*accounting.BalanceResponse, error) + Balance(context.Context, *accGRPC.BalanceRequest) (*accGRPC.BalanceResponse, error) } diff --git a/pkg/services/accounting/sign.go b/pkg/services/accounting/sign.go index e98d9b3af..afb65ad97 100644 --- a/pkg/services/accounting/sign.go +++ b/pkg/services/accounting/sign.go @@ -4,7 +4,7 @@ import ( "context" "crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + accGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -21,18 +21,18 @@ func NewSignService(key *ecdsa.PrivateKey, svc Server) Server { } } -func (s *signService) Balance(ctx context.Context, req *accounting.BalanceRequest) (*accounting.BalanceResponse, error) { +func (s *signService) Balance(ctx context.Context, req *accGRPC.BalanceRequest) (*accGRPC.BalanceResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Balance(ctx, req.(*accounting.BalanceRequest)) + return s.svc.Balance(ctx, req.(*accGRPC.BalanceRequest)) }, func() util.ResponseMessage { - return new(accounting.BalanceResponse) + return new(accGRPC.BalanceResponse) }, ) if err != nil { return nil, err } - return resp.(*accounting.BalanceResponse), nil + return resp.(*accGRPC.BalanceResponse), nil } diff --git a/pkg/services/container/announcement/load/controller/calls_test.go b/pkg/services/container/announcement/load/controller/calls_test.go index 6ca24e869..044d65f51 100644 --- a/pkg/services/container/announcement/load/controller/calls_test.go +++ b/pkg/services/container/announcement/load/controller/calls_test.go @@ -74,6 +74,7 @@ func (s *testAnnouncementStorage) Close(context.Context) error { } func randAnnouncement() (a container.SizeEstimation) { + a = *container.NewSizeEstimation() a.SetContainer(cidtest.ID()) a.SetValue(rand.Uint64()) diff --git a/pkg/services/container/announcement/load/storage/storage_test.go b/pkg/services/container/announcement/load/storage/storage_test.go index 20e73627d..efca98524 100644 --- a/pkg/services/container/announcement/load/storage/storage_test.go +++ b/pkg/services/container/announcement/load/storage/storage_test.go @@ -12,7 +12,7 @@ import ( func TestStorage(t *testing.T) { const epoch uint64 = 13 - var a container.SizeEstimation + a := *container.NewSizeEstimation() a.SetContainer(cidtest.ID()) a.SetEpoch(epoch) diff --git a/pkg/services/container/executor.go b/pkg/services/container/executor.go index d4ae11d62..96ac9da9b 100644 --- a/pkg/services/container/executor.go +++ b/pkg/services/container/executor.go @@ -4,18 +4,19 @@ import ( "context" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response" ) type ServiceExecutor interface { - Put(context.Context, *session.Token, *container.PutRequestBody) (*container.PutResponseBody, error) - Delete(context.Context, *session.Token, *container.DeleteRequestBody) (*container.DeleteResponseBody, error) - Get(context.Context, *container.GetRequestBody) (*container.GetResponseBody, error) - List(context.Context, *container.ListRequestBody) (*container.ListResponseBody, error) - SetExtendedACL(context.Context, *session.Token, *container.SetExtendedACLRequestBody) (*container.SetExtendedACLResponseBody, error) - GetExtendedACL(context.Context, *container.GetExtendedACLRequestBody) (*container.GetExtendedACLResponseBody, error) + Put(context.Context, *sessionGRPC.SessionToken, *containerGRPC.PutRequest_Body) (*containerGRPC.PutResponse_Body, error) + Delete(context.Context, *sessionGRPC.SessionToken, *containerGRPC.DeleteRequest_Body) (*containerGRPC.DeleteResponse_Body, error) + Get(context.Context, *containerGRPC.GetRequest_Body) (*containerGRPC.GetResponse_Body, error) + List(context.Context, *containerGRPC.ListRequest_Body) (*containerGRPC.ListResponse_Body, error) + SetExtendedACL(context.Context, *sessionGRPC.SessionToken, *containerGRPC.SetExtendedACLRequest_Body) (*containerGRPC.SetExtendedACLResponse_Body, error) + GetExtendedACL(context.Context, *containerGRPC.GetExtendedACLRequest_Body) (*containerGRPC.GetExtendedACLResponse_Body, error) } type executorSvc struct { @@ -34,7 +35,7 @@ func NewExecutionService(exec ServiceExecutor, respSvc *response.Service) Server } } -func (s *executorSvc) Put(ctx context.Context, req *container.PutRequest) (*container.PutResponse, error) { +func (s *executorSvc) Put(ctx context.Context, req *containerGRPC.PutRequest) (*containerGRPC.PutResponse, error) { meta := req.GetMetaHeader() for origin := meta.GetOrigin(); origin != nil; origin = meta.GetOrigin() { meta = origin @@ -52,7 +53,7 @@ func (s *executorSvc) Put(ctx context.Context, req *container.PutRequest) (*cont return resp, nil } -func (s *executorSvc) Delete(ctx context.Context, req *container.DeleteRequest) (*container.DeleteResponse, error) { +func (s *executorSvc) Delete(ctx context.Context, req *containerGRPC.DeleteRequest) (*containerGRPC.DeleteResponse, error) { meta := req.GetMetaHeader() for origin := meta.GetOrigin(); origin != nil; origin = meta.GetOrigin() { meta = origin @@ -70,7 +71,7 @@ func (s *executorSvc) Delete(ctx context.Context, req *container.DeleteRequest) return resp, nil } -func (s *executorSvc) Get(ctx context.Context, req *container.GetRequest) (*container.GetResponse, error) { +func (s *executorSvc) Get(ctx context.Context, req *containerGRPC.GetRequest) (*containerGRPC.GetResponse, error) { respBody, err := s.exec.Get(ctx, req.GetBody()) if err != nil { return nil, fmt.Errorf("could not execute Get request: %w", err) @@ -83,7 +84,7 @@ func (s *executorSvc) Get(ctx context.Context, req *container.GetRequest) (*cont return resp, nil } -func (s *executorSvc) List(ctx context.Context, req *container.ListRequest) (*container.ListResponse, error) { +func (s *executorSvc) List(ctx context.Context, req *containerGRPC.ListRequest) (*containerGRPC.ListResponse, error) { respBody, err := s.exec.List(ctx, req.GetBody()) if err != nil { return nil, fmt.Errorf("could not execute List request: %w", err) @@ -96,7 +97,7 @@ func (s *executorSvc) List(ctx context.Context, req *container.ListRequest) (*co return resp, nil } -func (s *executorSvc) SetExtendedACL(ctx context.Context, req *container.SetExtendedACLRequest) (*container.SetExtendedACLResponse, error) { +func (s *executorSvc) SetExtendedACL(ctx context.Context, req *containerGRPC.SetExtendedACLRequest) (*containerGRPC.SetExtendedACLResponse, error) { meta := req.GetMetaHeader() for origin := meta.GetOrigin(); origin != nil; origin = meta.GetOrigin() { meta = origin @@ -114,7 +115,7 @@ func (s *executorSvc) SetExtendedACL(ctx context.Context, req *container.SetExte return resp, nil } -func (s *executorSvc) GetExtendedACL(ctx context.Context, req *container.GetExtendedACLRequest) (*container.GetExtendedACLResponse, error) { +func (s *executorSvc) GetExtendedACL(ctx context.Context, req *containerGRPC.GetExtendedACLRequest) (*containerGRPC.GetExtendedACLResponse, error) { respBody, err := s.exec.GetExtendedACL(ctx, req.GetBody()) if err != nil { return nil, fmt.Errorf("could not execute GetEACL request: %w", err) diff --git a/pkg/services/container/morph/executor.go b/pkg/services/container/morph/executor.go index dec022219..87cf98b1a 100644 --- a/pkg/services/container/morph/executor.go +++ b/pkg/services/container/morph/executor.go @@ -5,9 +5,9 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + refGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" containerSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" @@ -49,7 +49,7 @@ func NewExecutor(rdr Reader, wrt Writer) containerSvc.ServiceExecutor { } } -func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.Token, body *container.PutRequestBody) (*container.PutResponseBody, error) { +func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.SessionToken, body *containerGRPC.PutRequest_Body) (*containerGRPC.PutResponse_Body, error) { sigV2 := body.GetSignature() if sigV2 == nil { // TODO(@cthulhu-rider): #468 use "const" error @@ -63,12 +63,12 @@ func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.Token, body *con var cnr containercore.Container - err := cnr.Value.ReadFromV2(*cnrV2) + err := cnr.Value.ReadFromV2(cnrV2) if err != nil { return nil, fmt.Errorf("invalid container: %w", err) } - err = cnr.Signature.ReadFromV2(*sigV2) + err = cnr.Signature.ReadFromV2(sigV2.FromRFC6979()) if err != nil { return nil, fmt.Errorf("can't read signature: %w", err) } @@ -76,7 +76,7 @@ func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.Token, body *con if tokV2 != nil { cnr.Session = new(session.Container) - err := cnr.Session.ReadFromV2(*tokV2) + err := cnr.Session.ReadFromV2(tokV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } @@ -87,24 +87,24 @@ func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.Token, body *con return nil, err } - var idCnrV2 refs.ContainerID + var idCnrV2 refGRPC.ContainerID idCnr.WriteToV2(&idCnrV2) - res := new(container.PutResponseBody) - res.SetContainerID(&idCnrV2) + res := new(containerGRPC.PutResponse_Body) + res.SetContainerId(&idCnrV2) return res, nil } -func (s *morphExecutor) Delete(_ context.Context, tokV2 *sessionV2.Token, body *container.DeleteRequestBody) (*container.DeleteResponseBody, error) { - idV2 := body.GetContainerID() +func (s *morphExecutor) Delete(_ context.Context, tokV2 *sessionV2.SessionToken, body *containerGRPC.DeleteRequest_Body) (*containerGRPC.DeleteResponse_Body, error) { + idV2 := body.GetContainerId() if idV2 == nil { return nil, errors.New("missing container ID") } var id cid.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid container ID: %w", err) } @@ -114,7 +114,7 @@ func (s *morphExecutor) Delete(_ context.Context, tokV2 *sessionV2.Token, body * if tokV2 != nil { tok = new(session.Container) - err := tok.ReadFromV2(*tokV2) + err := tok.ReadFromV2(tokV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } @@ -123,7 +123,7 @@ func (s *morphExecutor) Delete(_ context.Context, tokV2 *sessionV2.Token, body * var rmWitness containercore.RemovalWitness rmWitness.ContainerID = id - rmWitness.Signature = body.GetSignature() + rmWitness.Signature = body.GetSignature().FromRFC6979() rmWitness.SessionToken = tok err = s.wrt.Delete(rmWitness) @@ -131,18 +131,18 @@ func (s *morphExecutor) Delete(_ context.Context, tokV2 *sessionV2.Token, body * return nil, err } - return new(container.DeleteResponseBody), nil + return new(containerGRPC.DeleteResponse_Body), nil } -func (s *morphExecutor) Get(_ context.Context, body *container.GetRequestBody) (*container.GetResponseBody, error) { - idV2 := body.GetContainerID() +func (s *morphExecutor) Get(_ context.Context, body *containerGRPC.GetRequest_Body) (*containerGRPC.GetResponse_Body, error) { + idV2 := body.GetContainerId() if idV2 == nil { return nil, errors.New("missing container ID") } var id cid.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid container ID: %w", err) } @@ -152,37 +152,37 @@ func (s *morphExecutor) Get(_ context.Context, body *container.GetRequestBody) ( return nil, err } - sigV2 := new(refs.Signature) + sigV2 := new(refGRPC.Signature) cnr.Signature.WriteToV2(sigV2) - var tokV2 *sessionV2.Token + var tokV2 *sessionV2.SessionToken if cnr.Session != nil { - tokV2 = new(sessionV2.Token) + tokV2 = new(sessionV2.SessionToken) cnr.Session.WriteToV2(tokV2) } - var cnrV2 container.Container + var cnrV2 containerGRPC.Container cnr.Value.WriteToV2(&cnrV2) - res := new(container.GetResponseBody) + res := new(containerGRPC.GetResponse_Body) res.SetContainer(&cnrV2) - res.SetSignature(sigV2) + res.SetSignature(sigV2.ToRFC6979()) res.SetSessionToken(tokV2) return res, nil } -func (s *morphExecutor) List(_ context.Context, body *container.ListRequestBody) (*container.ListResponseBody, error) { - idV2 := body.GetOwnerID() +func (s *morphExecutor) List(_ context.Context, body *containerGRPC.ListRequest_Body) (*containerGRPC.ListResponse_Body, error) { + idV2 := body.GetOwnerId() if idV2 == nil { return nil, fmt.Errorf("missing user ID") } var id user.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid user ID: %w", err) } @@ -192,18 +192,19 @@ func (s *morphExecutor) List(_ context.Context, body *container.ListRequestBody) return nil, err } - cidList := make([]refs.ContainerID, len(cnrs)) + cidList := make([]*refGRPC.ContainerID, len(cnrs)) for i := range cnrs { - cnrs[i].WriteToV2(&cidList[i]) + cidList[i] = new(refGRPC.ContainerID) + cnrs[i].WriteToV2(cidList[i]) } - res := new(container.ListResponseBody) - res.SetContainerIDs(cidList) + res := new(containerGRPC.ListResponse_Body) + res.SetContainerIds(cidList) return res, nil } -func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.Token, body *container.SetExtendedACLRequestBody) (*container.SetExtendedACLResponseBody, error) { +func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.SessionToken, body *containerGRPC.SetExtendedACLRequest_Body) (*containerGRPC.SetExtendedACLResponse_Body, error) { sigV2 := body.GetSignature() if sigV2 == nil { // TODO(@cthulhu-rider): #468 use "const" error @@ -211,10 +212,10 @@ func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.Token } eaclInfo := containercore.EACL{ - Value: eaclSDK.NewTableFromV2(body.GetEACL()), + Value: eaclSDK.NewTableFromV2(body.GetEacl()), } - err := eaclInfo.Signature.ReadFromV2(*sigV2) + err := eaclInfo.Signature.ReadFromV2(sigV2.FromRFC6979()) if err != nil { return nil, fmt.Errorf("can't read signature: %w", err) } @@ -222,7 +223,7 @@ func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.Token if tokV2 != nil { eaclInfo.Session = new(session.Container) - err := eaclInfo.Session.ReadFromV2(*tokV2) + err := eaclInfo.Session.ReadFromV2(tokV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } @@ -233,18 +234,18 @@ func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.Token return nil, err } - return new(container.SetExtendedACLResponseBody), nil + return new(containerGRPC.SetExtendedACLResponse_Body), nil } -func (s *morphExecutor) GetExtendedACL(_ context.Context, body *container.GetExtendedACLRequestBody) (*container.GetExtendedACLResponseBody, error) { - idV2 := body.GetContainerID() +func (s *morphExecutor) GetExtendedACL(_ context.Context, body *containerGRPC.GetExtendedACLRequest_Body) (*containerGRPC.GetExtendedACLResponse_Body, error) { + idV2 := body.GetContainerId() if idV2 == nil { return nil, errors.New("missing container ID") } var id cid.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid container ID: %w", err) } @@ -254,20 +255,20 @@ func (s *morphExecutor) GetExtendedACL(_ context.Context, body *container.GetExt return nil, err } - var sigV2 refs.Signature + var sigV2 refGRPC.Signature eaclInfo.Signature.WriteToV2(&sigV2) - var tokV2 *sessionV2.Token + var tokV2 *sessionV2.SessionToken if eaclInfo.Session != nil { - tokV2 = new(sessionV2.Token) + tokV2 = new(sessionV2.SessionToken) eaclInfo.Session.WriteToV2(tokV2) } - res := new(container.GetExtendedACLResponseBody) - res.SetEACL(eaclInfo.Value.ToV2()) - res.SetSignature(&sigV2) + res := new(containerGRPC.GetExtendedACLResponse_Body) + res.SetEacl(eaclInfo.Value.ToV2()) + res.SetSignature(sigV2.ToRFC6979()) res.SetSessionToken(tokV2) return res, nil diff --git a/pkg/services/container/morph/executor_test.go b/pkg/services/container/morph/executor_test.go index a270ee856..0b3c11179 100644 --- a/pkg/services/container/morph/executor_test.go +++ b/pkg/services/container/morph/executor_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" containerCore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" containerSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/container" containerSvcMorph "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/container/morph" @@ -42,7 +42,7 @@ func TestInvalidToken(t *testing.T) { cnr := cidtest.ID() - var cnrV2 refs.ContainerID + var cnrV2 refsGRPC.ContainerID cnr.WriteToV2(&cnrV2) priv, err := keys.NewPrivateKey() @@ -50,32 +50,32 @@ func TestInvalidToken(t *testing.T) { sign := func(reqBody interface { StableMarshal([]byte) []byte - SetSignature(signature *refs.Signature) + SetSignature(signature *refsGRPC.SignatureRFC6979) }) { signer := frostfsecdsa.Signer(priv.PrivateKey) - var sig frostfscrypto.Signature + sig := frostfscrypto.NewSignature() require.NoError(t, sig.Calculate(signer, reqBody.StableMarshal(nil))) - var sigV2 refs.Signature + var sigV2 refsGRPC.Signature sig.WriteToV2(&sigV2) - reqBody.SetSignature(&sigV2) + reqBody.SetSignature(sigV2.ToRFC6979()) } - var tokV2 session.Token + var tokV2 sessionGRPC.SessionToken sessiontest.ContainerSigned().WriteToV2(&tokV2) tests := []struct { name string - op func(e containerSvc.ServiceExecutor, tokV2 *session.Token) error + op func(e containerSvc.ServiceExecutor, tokV2 *sessionGRPC.SessionToken) error }{ { name: "put", - op: func(e containerSvc.ServiceExecutor, tokV2 *session.Token) (err error) { - var reqBody container.PutRequestBody + op: func(e containerSvc.ServiceExecutor, tokV2 *sessionGRPC.SessionToken) (err error) { + var reqBody containerGRPC.PutRequest_Body cnr := containertest.Container() - var cnrV2 container.Container + var cnrV2 containerGRPC.Container cnr.WriteToV2(&cnrV2) reqBody.SetContainer(&cnrV2) @@ -87,9 +87,9 @@ func TestInvalidToken(t *testing.T) { }, { name: "delete", - op: func(e containerSvc.ServiceExecutor, tokV2 *session.Token) (err error) { - var reqBody container.DeleteRequestBody - reqBody.SetContainerID(&cnrV2) + op: func(e containerSvc.ServiceExecutor, tokV2 *sessionGRPC.SessionToken) (err error) { + var reqBody containerGRPC.DeleteRequest_Body + reqBody.SetContainerId(&cnrV2) _, err = e.Delete(context.TODO(), tokV2, &reqBody) return @@ -97,9 +97,9 @@ func TestInvalidToken(t *testing.T) { }, { name: "setEACL", - op: func(e containerSvc.ServiceExecutor, tokV2 *session.Token) (err error) { - var reqBody container.SetExtendedACLRequestBody - reqBody.SetSignature(new(refs.Signature)) + op: func(e containerSvc.ServiceExecutor, tokV2 *sessionGRPC.SessionToken) (err error) { + var reqBody containerGRPC.SetExtendedACLRequest_Body + reqBody.SetSignature(new(refsGRPC.SignatureRFC6979)) sign(&reqBody) _, err = e.SetExtendedACL(context.TODO(), tokV2, &reqBody) @@ -110,7 +110,7 @@ func TestInvalidToken(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - tok := generateToken(new(session.ObjectSessionContext)) + tok := generateToken(new(sessionGRPC.ContainerSessionContext)) require.Error(t, test.op(e, tok)) require.NoError(t, test.op(e, &tokV2)) @@ -120,11 +120,11 @@ func TestInvalidToken(t *testing.T) { } } -func generateToken(ctx session.TokenContext) *session.Token { - body := new(session.TokenBody) - body.SetContext(ctx) +func generateToken(ctx *sessionGRPC.ContainerSessionContext) *sessionGRPC.SessionToken { + body := new(sessionGRPC.SessionToken_Body) + body.SetContainerSessionContext(ctx) - tok := new(session.Token) + tok := new(sessionGRPC.SessionToken) tok.SetBody(body) return tok diff --git a/pkg/services/container/server.go b/pkg/services/container/server.go index 052a8c945..520954337 100644 --- a/pkg/services/container/server.go +++ b/pkg/services/container/server.go @@ -3,16 +3,16 @@ package container import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" ) // Server is an interface of the FrostFS API Container service server. type Server interface { - Put(context.Context, *container.PutRequest) (*container.PutResponse, error) - Get(context.Context, *container.GetRequest) (*container.GetResponse, error) - Delete(context.Context, *container.DeleteRequest) (*container.DeleteResponse, error) - List(context.Context, *container.ListRequest) (*container.ListResponse, error) - SetExtendedACL(context.Context, *container.SetExtendedACLRequest) (*container.SetExtendedACLResponse, error) - GetExtendedACL(context.Context, *container.GetExtendedACLRequest) (*container.GetExtendedACLResponse, error) - AnnounceUsedSpace(context.Context, *container.AnnounceUsedSpaceRequest) (*container.AnnounceUsedSpaceResponse, error) + Put(context.Context, *containerGRPC.PutRequest) (*containerGRPC.PutResponse, error) + Get(context.Context, *containerGRPC.GetRequest) (*containerGRPC.GetResponse, error) + Delete(context.Context, *containerGRPC.DeleteRequest) (*containerGRPC.DeleteResponse, error) + List(context.Context, *containerGRPC.ListRequest) (*containerGRPC.ListResponse, error) + SetExtendedACL(context.Context, *containerGRPC.SetExtendedACLRequest) (*containerGRPC.SetExtendedACLResponse, error) + GetExtendedACL(context.Context, *containerGRPC.GetExtendedACLRequest) (*containerGRPC.GetExtendedACLResponse, error) + AnnounceUsedSpace(context.Context, *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) } diff --git a/pkg/services/container/sign.go b/pkg/services/container/sign.go index 9e77e2e21..5fe41e1a5 100644 --- a/pkg/services/container/sign.go +++ b/pkg/services/container/sign.go @@ -4,7 +4,8 @@ import ( "context" "crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + containerGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -21,10 +22,10 @@ func NewSignService(key *ecdsa.PrivateKey, svc Server) Server { } } -func (s *signService) Put(ctx context.Context, req *container.PutRequest) (*container.PutResponse, error) { +func (s *signService) Put(ctx context.Context, req *containerGRPC.PutRequest) (*containerGRPC.PutResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Put(ctx, req.(*container.PutRequest)) + return s.svc.Put(ctx, req.(*containerGRPC.PutRequest)) }, func() util.ResponseMessage { return new(container.PutResponse) @@ -34,13 +35,13 @@ func (s *signService) Put(ctx context.Context, req *container.PutRequest) (*cont return nil, err } - return resp.(*container.PutResponse), nil + return resp.(*containerGRPC.PutResponse), nil } -func (s *signService) Delete(ctx context.Context, req *container.DeleteRequest) (*container.DeleteResponse, error) { +func (s *signService) Delete(ctx context.Context, req *containerGRPC.DeleteRequest) (*containerGRPC.DeleteResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Delete(ctx, req.(*container.DeleteRequest)) + return s.svc.Delete(ctx, req.(*containerGRPC.DeleteRequest)) }, func() util.ResponseMessage { return new(container.DeleteResponse) @@ -50,13 +51,13 @@ func (s *signService) Delete(ctx context.Context, req *container.DeleteRequest) return nil, err } - return resp.(*container.DeleteResponse), nil + return resp.(*containerGRPC.DeleteResponse), nil } -func (s *signService) Get(ctx context.Context, req *container.GetRequest) (*container.GetResponse, error) { +func (s *signService) Get(ctx context.Context, req *containerGRPC.GetRequest) (*containerGRPC.GetResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Get(ctx, req.(*container.GetRequest)) + return s.svc.Get(ctx, req.(*containerGRPC.GetRequest)) }, func() util.ResponseMessage { return new(container.GetResponse) @@ -66,13 +67,13 @@ func (s *signService) Get(ctx context.Context, req *container.GetRequest) (*cont return nil, err } - return resp.(*container.GetResponse), nil + return resp.(*containerGRPC.GetResponse), nil } -func (s *signService) List(ctx context.Context, req *container.ListRequest) (*container.ListResponse, error) { +func (s *signService) List(ctx context.Context, req *containerGRPC.ListRequest) (*containerGRPC.ListResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.List(ctx, req.(*container.ListRequest)) + return s.svc.List(ctx, req.(*containerGRPC.ListRequest)) }, func() util.ResponseMessage { return new(container.ListResponse) @@ -82,13 +83,13 @@ func (s *signService) List(ctx context.Context, req *container.ListRequest) (*co return nil, err } - return resp.(*container.ListResponse), nil + return resp.(*containerGRPC.ListResponse), nil } -func (s *signService) SetExtendedACL(ctx context.Context, req *container.SetExtendedACLRequest) (*container.SetExtendedACLResponse, error) { +func (s *signService) SetExtendedACL(ctx context.Context, req *containerGRPC.SetExtendedACLRequest) (*containerGRPC.SetExtendedACLResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.SetExtendedACL(ctx, req.(*container.SetExtendedACLRequest)) + return s.svc.SetExtendedACL(ctx, req.(*containerGRPC.SetExtendedACLRequest)) }, func() util.ResponseMessage { return new(container.SetExtendedACLResponse) @@ -98,13 +99,13 @@ func (s *signService) SetExtendedACL(ctx context.Context, req *container.SetExte return nil, err } - return resp.(*container.SetExtendedACLResponse), nil + return resp.(*containerGRPC.SetExtendedACLResponse), nil } -func (s *signService) GetExtendedACL(ctx context.Context, req *container.GetExtendedACLRequest) (*container.GetExtendedACLResponse, error) { +func (s *signService) GetExtendedACL(ctx context.Context, req *containerGRPC.GetExtendedACLRequest) (*containerGRPC.GetExtendedACLResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.GetExtendedACL(ctx, req.(*container.GetExtendedACLRequest)) + return s.svc.GetExtendedACL(ctx, req.(*containerGRPC.GetExtendedACLRequest)) }, func() util.ResponseMessage { return new(container.GetExtendedACLResponse) @@ -114,13 +115,13 @@ func (s *signService) GetExtendedACL(ctx context.Context, req *container.GetExte return nil, err } - return resp.(*container.GetExtendedACLResponse), nil + return resp.(*containerGRPC.GetExtendedACLResponse), nil } -func (s *signService) AnnounceUsedSpace(ctx context.Context, req *container.AnnounceUsedSpaceRequest) (*container.AnnounceUsedSpaceResponse, error) { +func (s *signService) AnnounceUsedSpace(ctx context.Context, req *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.AnnounceUsedSpace(ctx, req.(*container.AnnounceUsedSpaceRequest)) + return s.svc.AnnounceUsedSpace(ctx, req.(*containerGRPC.AnnounceUsedSpaceRequest)) }, func() util.ResponseMessage { return new(container.AnnounceUsedSpaceResponse) @@ -130,5 +131,5 @@ func (s *signService) AnnounceUsedSpace(ctx context.Context, req *container.Anno return nil, err } - return resp.(*container.AnnounceUsedSpaceResponse), nil + return resp.(*containerGRPC.AnnounceUsedSpaceResponse), nil } diff --git a/pkg/services/control/ir/rpc.go b/pkg/services/control/ir/rpc.go index 1b635c149..e18085046 100644 --- a/pkg/services/control/ir/rpc.go +++ b/pkg/services/control/ir/rpc.go @@ -3,7 +3,6 @@ package control import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" ) const serviceName = "ircontrol.ControlService" @@ -20,7 +19,9 @@ func HealthCheck( req *HealthCheckRequest, opts ...client.CallOption, ) (*HealthCheckResponse, error) { - return sendUnary[HealthCheckRequest, HealthCheckResponse](cli, rpcHealthCheck, req, opts...) + resp := new(HealthCheckResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcHealthCheck), req, resp, opts...) + return resp, err } // TickEpoch executes ControlService.TickEpoch RPC. @@ -29,7 +30,9 @@ func TickEpoch( req *TickEpochRequest, opts ...client.CallOption, ) (*TickEpochResponse, error) { - return sendUnary[TickEpochRequest, TickEpochResponse](cli, rpcTickEpoch, req, opts...) + resp := new(TickEpochResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcTickEpoch), req, resp, opts...) + return resp, err } func RemoveNode( @@ -37,23 +40,7 @@ func RemoveNode( req *RemoveNodeRequest, opts ...client.CallOption, ) (*RemoveNodeResponse, error) { - return sendUnary[RemoveNodeRequest, RemoveNodeResponse](cli, rpcRemoveNode, req, opts...) -} - -func sendUnary[I, O grpc.Message](cli *client.Client, rpcName string, req *I, opts ...client.CallOption) (*O, error) { - var resp O - wResp := &responseWrapper[*O]{ - m: &resp, - } - - wReq := &requestWrapper{ - m: req, - } - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcName), wReq, wResp, opts...) - if err != nil { - return nil, err - } - - return wResp.m, nil + resp := new(RemoveNodeResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcRemoveNode), req, resp, opts...) + return resp, err } diff --git a/pkg/services/control/ir/server/calls.go b/pkg/services/control/ir/server/calls.go index 680d1e606..c10d32c91 100644 --- a/pkg/services/control/ir/server/calls.go +++ b/pkg/services/control/ir/server/calls.go @@ -75,7 +75,7 @@ func (s *Server) RemoveNode(_ context.Context, req *control.RemoveNodeRequest) ( if err != nil { return nil, fmt.Errorf("getting netmap: %w", err) } - var nodeInfo netmap.NodeInfo + nodeInfo := netmap.NewNodeInfo() for _, info := range nm.Nodes() { if bytes.Equal(info.PublicKey(), req.GetBody().GetKey()) { nodeInfo = info diff --git a/pkg/services/control/ir/server/sign.go b/pkg/services/control/ir/server/sign.go index f72d51f9e..432859606 100644 --- a/pkg/services/control/ir/server/sign.go +++ b/pkg/services/control/ir/server/sign.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" control "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control/ir" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -50,14 +50,14 @@ func (s *Server) isValidRequest(req SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + var sigV2 refsGRPC.Signature sigV2.SetKey(sign.GetKey()) sigV2.SetSign(sign.GetSign()) - sigV2.SetScheme(refs.ECDSA_SHA512) + sigV2.SetScheme(refsGRPC.SignatureScheme_ECDSA_SHA512) - var sig frostfscrypto.Signature - if err := sig.ReadFromV2(sigV2); err != nil { + sig := frostfscrypto.NewSignature() + if err := sig.ReadFromV2(&sigV2); err != nil { return fmt.Errorf("can't read signature: %w", err) } @@ -76,15 +76,15 @@ func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - var sig frostfscrypto.Signature + sig := frostfscrypto.NewSignature() err = sig.Calculate(frostfsecdsa.Signer(*key), binBody) if err != nil { return fmt.Errorf("calculate signature: %w", err) } - // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + var sigV2 refsGRPC.Signature sig.WriteToV2(&sigV2) var sigControl control.Signature diff --git a/pkg/services/control/rpc.go b/pkg/services/control/rpc.go index a2e7c411a..04ec8aa57 100644 --- a/pkg/services/control/rpc.go +++ b/pkg/services/control/rpc.go @@ -28,17 +28,13 @@ func HealthCheck( req *HealthCheckRequest, opts ...client.CallOption, ) (*HealthCheckResponse, error) { - wResp := newResponseWrapper[HealthCheckResponse]() - wReq := &requestWrapper{ - m: req, - } - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcHealthCheck), wReq, wResp, opts...) + resp := new(HealthCheckResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcHealthCheck), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // SetNetmapStatus executes ControlService.SetNetmapStatus RPC. @@ -47,18 +43,13 @@ func SetNetmapStatus( req *SetNetmapStatusRequest, opts ...client.CallOption, ) (*SetNetmapStatusResponse, error) { - wResp := newResponseWrapper[SetNetmapStatusResponse]() - - wReq := &requestWrapper{ - m: req, - } - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSetNetmapStatus), wReq, wResp, opts...) + resp := new(SetNetmapStatusResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSetNetmapStatus), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // DropObjects executes ControlService.DropObjects RPC. @@ -67,17 +58,13 @@ func DropObjects( req *DropObjectsRequest, opts ...client.CallOption, ) (*DropObjectsResponse, error) { - wResp := newResponseWrapper[DropObjectsResponse]() - - wReq := &requestWrapper{ - m: req, - } - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcDropObjects), wReq, wResp, opts...) + resp := new(DropObjectsResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcDropObjects), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // ListShards executes ControlService.ListShards RPC. @@ -86,17 +73,13 @@ func ListShards( req *ListShardsRequest, opts ...client.CallOption, ) (*ListShardsResponse, error) { - wResp := newResponseWrapper[ListShardsResponse]() - - wReq := &requestWrapper{ - m: req, - } - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcListShards), wReq, wResp, opts...) + resp := new(ListShardsResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcListShards), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // SetShardMode executes ControlService.SetShardMode RPC. @@ -105,106 +88,88 @@ func SetShardMode( req *SetShardModeRequest, opts ...client.CallOption, ) (*SetShardModeResponse, error) { - wResp := newResponseWrapper[SetShardModeResponse]() - - wReq := &requestWrapper{ - m: req, - } - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSetShardMode), wReq, wResp, opts...) + resp := new(SetShardModeResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSetShardMode), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // SynchronizeTree executes ControlService.SynchronizeTree RPC. func SynchronizeTree(cli *client.Client, req *SynchronizeTreeRequest, opts ...client.CallOption) (*SynchronizeTreeResponse, error) { - wResp := newResponseWrapper[SynchronizeTreeResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSynchronizeTree), wReq, wResp, opts...) + resp := new(SynchronizeTreeResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSynchronizeTree), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // EvacuateShard executes ControlService.EvacuateShard RPC. func EvacuateShard(cli *client.Client, req *EvacuateShardRequest, opts ...client.CallOption) (*EvacuateShardResponse, error) { - wResp := newResponseWrapper[EvacuateShardResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcEvacuateShard), wReq, wResp, opts...) + resp := new(EvacuateShardResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcEvacuateShard), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // StartShardEvacuation executes ControlService.StartShardEvacuation RPC. func StartShardEvacuation(cli *client.Client, req *StartShardEvacuationRequest, opts ...client.CallOption) (*StartShardEvacuationResponse, error) { - wResp := newResponseWrapper[StartShardEvacuationResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcStartShardEvacuation), wReq, wResp, opts...) + resp := new(StartShardEvacuationResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcStartShardEvacuation), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // GetShardEvacuationStatus executes ControlService.GetShardEvacuationStatus RPC. func GetShardEvacuationStatus(cli *client.Client, req *GetShardEvacuationStatusRequest, opts ...client.CallOption) (*GetShardEvacuationStatusResponse, error) { - wResp := newResponseWrapper[GetShardEvacuationStatusResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcGetShardEvacuationStatus), wReq, wResp, opts...) + resp := new(GetShardEvacuationStatusResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcGetShardEvacuationStatus), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // StopShardEvacuation executes ControlService.StopShardEvacuation RPC. func StopShardEvacuation(cli *client.Client, req *StopShardEvacuationRequest, opts ...client.CallOption) (*StopShardEvacuationResponse, error) { - wResp := newResponseWrapper[StopShardEvacuationResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcStopShardEvacuation), wReq, wResp, opts...) + resp := new(StopShardEvacuationResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcStopShardEvacuation), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // FlushCache executes ControlService.FlushCache RPC. func FlushCache(cli *client.Client, req *FlushCacheRequest, opts ...client.CallOption) (*FlushCacheResponse, error) { - wResp := newResponseWrapper[FlushCacheResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcFlushCache), wReq, wResp, opts...) + resp := new(FlushCacheResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcFlushCache), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } // Doctor executes ControlService.Doctor RPC. func Doctor(cli *client.Client, req *DoctorRequest, opts ...client.CallOption) (*DoctorResponse, error) { - wResp := newResponseWrapper[DoctorResponse]() - wReq := &requestWrapper{m: req} - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcDoctor), wReq, wResp, opts...) + resp := new(DoctorResponse) + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcDoctor), req, resp, opts...) if err != nil { return nil, err } - return wResp.message, nil + return resp, nil } diff --git a/pkg/services/control/server/sign.go b/pkg/services/control/server/sign.go index acc405821..baa3bf36d 100644 --- a/pkg/services/control/server/sign.go +++ b/pkg/services/control/server/sign.go @@ -6,7 +6,8 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -50,14 +51,14 @@ func (s *Server) isValidRequest(req SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion - var sigV2 refs.Signature + // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + var sigV2 refsGRPC.Signature sigV2.SetKey(sign.GetKey()) sigV2.SetSign(sign.GetSign()) - sigV2.SetScheme(refs.ECDSA_SHA512) + sigV2.SetScheme(refsGRPC.SignatureScheme_ECDSA_SHA512) - var sig frostfscrypto.Signature - if err := sig.ReadFromV2(sigV2); err != nil { + sig := frostfscrypto.NewSignature() + if err := sig.ReadFromV2(&sigV2); err != nil { return fmt.Errorf("can't read signature: %w", err) } @@ -76,7 +77,7 @@ func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - var sig frostfscrypto.Signature + sig := frostfscrypto.NewSignature() err = sig.Calculate(frostfsecdsa.Signer(*key), binBody) if err != nil { diff --git a/pkg/services/netmap/executor.go b/pkg/services/netmap/executor.go index d1e7a949e..309c09d62 100644 --- a/pkg/services/netmap/executor.go +++ b/pkg/services/netmap/executor.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/version" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response" netmapSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" @@ -14,7 +14,7 @@ import ( ) type executorSvc struct { - version refs.Version + version refsGRPC.Version state NodeState @@ -28,12 +28,12 @@ type executorSvc struct { type NodeState interface { // Must return current node state // in FrostFS API v2 NodeInfo structure. - LocalNodeInfo() (*netmap.NodeInfo, error) + LocalNodeInfo() (*netmapGRPC.NodeInfo, error) // ReadCurrentNetMap reads current local network map of the storage node // into the given parameter. Returns any error encountered which prevented // the network map to be read. - ReadCurrentNetMap(*netmap.NetMap) error + ReadCurrentNetMap(*netmapGRPC.Netmap) error } // NetworkInfo encapsulates source of the @@ -64,40 +64,38 @@ func NewExecutionService(s NodeState, v versionsdk.Version, netInfo NetworkInfo, func (s *executorSvc) LocalNodeInfo( _ context.Context, - req *netmap.LocalNodeInfoRequest) (*netmap.LocalNodeInfoResponse, error) { + req *netmapGRPC.LocalNodeInfoRequest) (*netmapGRPC.LocalNodeInfoResponse, error) { verV2 := req.GetMetaHeader().GetVersion() if verV2 == nil { return nil, errors.New("missing version") } - var ver versionsdk.Version - if err := ver.ReadFromV2(*verV2); err != nil { - return nil, fmt.Errorf("can't read version: %w", err) - } + ver := versionsdk.NewVersion() + ver.ReadFromV2(verV2) ni, err := s.state.LocalNodeInfo() if err != nil { return nil, err } - if addrNum := ni.NumberOfAddresses(); addrNum > 0 && ver.Minor() <= 7 { - ni2 := new(netmap.NodeInfo) + if addrNum := ni.NumberOfAddresses(); addrNum > 0 && ver.GetMinor() <= 7 { + ni2 := new(netmapGRPC.NodeInfo) ni2.SetPublicKey(ni.GetPublicKey()) ni2.SetState(ni.GetState()) ni2.SetAttributes(ni.GetAttributes()) ni.IterateAddresses(func(s string) bool { - ni2.SetAddresses(s) + ni2.SetAddresses([]string{s}) return true }) ni = ni2 } - body := new(netmap.LocalNodeInfoResponseBody) + body := new(netmapGRPC.LocalNodeInfoResponse_Body) body.SetVersion(&s.version) body.SetNodeInfo(ni) - resp := new(netmap.LocalNodeInfoResponse) + resp := new(netmapGRPC.LocalNodeInfoResponse) resp.SetBody(body) s.respSvc.SetMeta(resp) @@ -106,47 +104,45 @@ func (s *executorSvc) LocalNodeInfo( func (s *executorSvc) NetworkInfo( _ context.Context, - req *netmap.NetworkInfoRequest) (*netmap.NetworkInfoResponse, error) { + req *netmapGRPC.NetworkInfoRequest) (*netmapGRPC.NetworkInfoResponse, error) { verV2 := req.GetMetaHeader().GetVersion() if verV2 == nil { return nil, errors.New("missing protocol version in meta header") } - var ver versionsdk.Version - if err := ver.ReadFromV2(*verV2); err != nil { - return nil, fmt.Errorf("can't read version: %w", err) - } + ver := versionsdk.NewVersion() + ver.ReadFromV2(verV2) ni, err := s.netInfo.Dump(ver) if err != nil { return nil, err } - var niV2 netmap.NetworkInfo + var niV2 netmapGRPC.NetworkInfo ni.WriteToV2(&niV2) - body := new(netmap.NetworkInfoResponseBody) + body := new(netmapGRPC.NetworkInfoResponse_Body) body.SetNetworkInfo(&niV2) - resp := new(netmap.NetworkInfoResponse) + resp := new(netmapGRPC.NetworkInfoResponse) resp.SetBody(body) s.respSvc.SetMeta(resp) return resp, nil } -func (s *executorSvc) Snapshot(_ context.Context, _ *netmap.SnapshotRequest) (*netmap.SnapshotResponse, error) { - var nm netmap.NetMap +func (s *executorSvc) Snapshot(_ context.Context, _ *netmapGRPC.NetmapSnapshotRequest) (*netmapGRPC.NetmapSnapshotResponse, error) { + var nm netmapGRPC.Netmap err := s.state.ReadCurrentNetMap(&nm) if err != nil { return nil, fmt.Errorf("read current local network map: %w", err) } - body := new(netmap.SnapshotResponseBody) - body.SetNetMap(&nm) + body := new(netmapGRPC.NetmapSnapshotResponse_Body) + body.SetNetmap(&nm) - resp := new(netmap.SnapshotResponse) + resp := new(netmapGRPC.NetmapSnapshotResponse) resp.SetBody(body) s.respSvc.SetMeta(resp) diff --git a/pkg/services/netmap/server.go b/pkg/services/netmap/server.go index 0a09c9f44..0cb67e478 100644 --- a/pkg/services/netmap/server.go +++ b/pkg/services/netmap/server.go @@ -3,12 +3,12 @@ package netmap import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" ) // Server is an interface of the FrostFS API Netmap service server. type Server interface { - LocalNodeInfo(context.Context, *netmap.LocalNodeInfoRequest) (*netmap.LocalNodeInfoResponse, error) - NetworkInfo(context.Context, *netmap.NetworkInfoRequest) (*netmap.NetworkInfoResponse, error) - Snapshot(context.Context, *netmap.SnapshotRequest) (*netmap.SnapshotResponse, error) + LocalNodeInfo(context.Context, *netmapGRPC.LocalNodeInfoRequest) (*netmapGRPC.LocalNodeInfoResponse, error) + NetworkInfo(context.Context, *netmapGRPC.NetworkInfoRequest) (*netmapGRPC.NetworkInfoResponse, error) + Snapshot(context.Context, *netmapGRPC.NetmapSnapshotRequest) (*netmapGRPC.NetmapSnapshotResponse, error) } diff --git a/pkg/services/netmap/sign.go b/pkg/services/netmap/sign.go index 85b19d862..d8a5b2553 100644 --- a/pkg/services/netmap/sign.go +++ b/pkg/services/netmap/sign.go @@ -4,7 +4,7 @@ import ( "context" "crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -23,50 +23,50 @@ func NewSignService(key *ecdsa.PrivateKey, svc Server) Server { func (s *signService) LocalNodeInfo( ctx context.Context, - req *netmap.LocalNodeInfoRequest) (*netmap.LocalNodeInfoResponse, error) { + req *netmapGRPC.LocalNodeInfoRequest) (*netmapGRPC.LocalNodeInfoResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.LocalNodeInfo(ctx, req.(*netmap.LocalNodeInfoRequest)) + return s.svc.LocalNodeInfo(ctx, req.(*netmapGRPC.LocalNodeInfoRequest)) }, func() util.ResponseMessage { - return new(netmap.LocalNodeInfoResponse) + return new(netmapGRPC.LocalNodeInfoResponse) }, ) if err != nil { return nil, err } - return resp.(*netmap.LocalNodeInfoResponse), nil + return resp.(*netmapGRPC.LocalNodeInfoResponse), nil } -func (s *signService) NetworkInfo(ctx context.Context, req *netmap.NetworkInfoRequest) (*netmap.NetworkInfoResponse, error) { +func (s *signService) NetworkInfo(ctx context.Context, req *netmapGRPC.NetworkInfoRequest) (*netmapGRPC.NetworkInfoResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.NetworkInfo(ctx, req.(*netmap.NetworkInfoRequest)) + return s.svc.NetworkInfo(ctx, req.(*netmapGRPC.NetworkInfoRequest)) }, func() util.ResponseMessage { - return new(netmap.NetworkInfoResponse) + return new(netmapGRPC.NetworkInfoResponse) }, ) if err != nil { return nil, err } - return resp.(*netmap.NetworkInfoResponse), nil + return resp.(*netmapGRPC.NetworkInfoResponse), nil } -func (s *signService) Snapshot(ctx context.Context, req *netmap.SnapshotRequest) (*netmap.SnapshotResponse, error) { +func (s *signService) Snapshot(ctx context.Context, req *netmapGRPC.NetmapSnapshotRequest) (*netmapGRPC.NetmapSnapshotResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Snapshot(ctx, req.(*netmap.SnapshotRequest)) + return s.svc.Snapshot(ctx, req.(*netmapGRPC.NetmapSnapshotRequest)) }, func() util.ResponseMessage { - return new(netmap.SnapshotResponse) + return new(netmapGRPC.NetmapSnapshotResponse) }, ) if err != nil { return nil, err } - return resp.(*netmap.SnapshotResponse), nil + return resp.(*netmapGRPC.NetmapSnapshotResponse), nil } diff --git a/pkg/services/object/acl/acl.go b/pkg/services/object/acl/acl.go index 351b4ad3b..3ec533115 100644 --- a/pkg/services/object/acl/acl.go +++ b/pkg/services/object/acl/acl.go @@ -133,7 +133,7 @@ func (c *Checker) CheckEACL(msg any, reqInfo v2.RequestInfo) error { reqInfo.CleanBearer() } - var table eaclSDK.Table + var table *eaclSDK.Table cnr := reqInfo.ContainerID() if bearerTok == nil { @@ -145,7 +145,7 @@ func (c *Checker) CheckEACL(msg any, reqInfo v2.RequestInfo) error { return err } - table = *eaclInfo.Value + table = eaclInfo.Value } else { table = bearerTok.EACLTable() } @@ -168,7 +168,7 @@ func (c *Checker) CheckEACL(msg any, reqInfo v2.RequestInfo) error { WithContainerID(&cnr). WithSenderKey(reqInfo.SenderKey()). WithHeaderSource(hdrSrc). - WithEACLTable(&table), + WithEACLTable(table), ) if action != eaclSDK.ActionAllow { @@ -249,7 +249,7 @@ func isValidBearer(reqInfo v2.RequestInfo, st netmap.State) error { } // 4. Then check if container owner signed this token. - if !bearerSDK.ResolveIssuer(*token).Equals(ownerCnr) { + if !bearerSDK.ResolveIssuer(token).Equals(ownerCnr) { // TODO: #767 in this case we can issue all owner keys from frostfs.id and check once again return errBearerNotSignedByOwner } diff --git a/pkg/services/object/acl/eacl/v2/eacl_test.go b/pkg/services/object/acl/eacl/v2/eacl_test.go index 6f879123b..a0582b3b5 100644 --- a/pkg/services/object/acl/eacl/v2/eacl_test.go +++ b/pkg/services/object/acl/eacl/v2/eacl_test.go @@ -6,9 +6,9 @@ import ( "errors" "testing" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" eaclSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" @@ -34,8 +34,12 @@ func (s *testLocalStorage) Head(ctx context.Context, addr oid.Address) (*objectS return s.obj, s.err } -func testXHeaders(strs ...string) []session.XHeader { - res := make([]session.XHeader, len(strs)/2) +func testXHeaders(strs ...string) []*sessionGRPC.XHeader { + res := make([]*sessionGRPC.XHeader, len(strs)/2) + + for i := range res { + res[i] = new(sessionGRPC.XHeader) + } for i := 0; i < len(strs); i += 2 { res[i/2].SetKey(strs[i]) @@ -48,10 +52,10 @@ func testXHeaders(strs ...string) []session.XHeader { func TestHeadRequest(t *testing.T) { req := new(objectV2.HeadRequest) - meta := new(session.RequestMetaHeader) + meta := new(sessionGRPC.RequestMetaHeader) req.SetMetaHeader(meta) - body := new(objectV2.HeadRequestBody) + body := new(objectV2.HeadRequest_Body) req.SetBody(body) addr := oidtest.Address() @@ -73,7 +77,7 @@ func TestHeadRequest(t *testing.T) { attrKey := "attr_key" attrVal := "attr_val" - var attr objectSDK.Attribute + attr := *objectSDK.NewAttribute() attr.SetKey(attrKey) attr.SetValue(attrVal) obj.SetAttributes(attr) diff --git a/pkg/services/object/acl/eacl/v2/headers.go b/pkg/services/object/acl/eacl/v2/headers.go index c7a1b7729..d90561c9f 100644 --- a/pkg/services/object/acl/eacl/v2/headers.go +++ b/pkg/services/object/acl/eacl/v2/headers.go @@ -6,9 +6,9 @@ import ( "fmt" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" eaclSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" @@ -32,11 +32,11 @@ type ObjectStorage interface { } type Request interface { - GetMetaHeader() *session.RequestMetaHeader + GetMetaHeader() *sessionGRPC.RequestMetaHeader } type Response interface { - GetMetaHeader() *session.ResponseMetaHeader + GetMetaHeader() *sessionGRPC.ResponseMetaHeader } type headerSource struct { @@ -86,14 +86,14 @@ func (h headerSource) HeadersOfType(typ eaclSDK.FilterHeaderType) ([]eaclSDK.Hea } } -type xHeader session.XHeader +type xHeader sessionGRPC.XHeader -func (x xHeader) Key() string { - return (*session.XHeader)(&x).GetKey() +func (x *xHeader) GetKey() string { + return (*sessionGRPC.XHeader)(x).GetKey() } -func (x xHeader) Value() string { - return (*session.XHeader)(&x).GetValue() +func (x *xHeader) GetValue() string { + return (*sessionGRPC.XHeader)(x).GetValue() } func requestHeaders(msg xHeaderSource) []eaclSDK.Header { @@ -136,19 +136,19 @@ func (h *cfg) readObjectHeadersFromRequestXHeaderSource(m requestXHeaderSource, dst.objectHeaders = addressHeaders(h.cnr, h.obj) case *objectV2.PutRequest: - if v, ok := req.GetBody().GetObjectPart().(*objectV2.PutObjectPartInit); ok { + if v, ok := req.GetBody().GetObjectPart().(*objectV2.PutRequest_Body_Init_); ok { oV2 := new(objectV2.Object) - oV2.SetObjectID(v.GetObjectID()) - oV2.SetHeader(v.GetHeader()) + oV2.SetObjectId(v.Init.GetObjectId()) + oV2.SetHeader(v.Init.GetHeader()) dst.objectHeaders = headersFromObject(objectSDK.NewFromV2(oV2), h.cnr, h.obj) } case *objectV2.SearchRequest: - cnrV2 := req.GetBody().GetContainerID() + cnrV2 := req.GetBody().GetContainerId() var cnr cid.ID if cnrV2 != nil { - if err := cnr.ReadFromV2(*cnrV2); err != nil { + if err := cnr.ReadFromV2(cnrV2); err != nil { return fmt.Errorf("can't parse container ID: %w", err) } } @@ -166,10 +166,10 @@ func (h *cfg) readObjectHeadersResponseXHeaderSource(m responseXHeaderSource, ds dst.objectHeaders = objectHeaders dst.incompleteObjectHeaders = !completed case *objectV2.GetResponse: - if v, ok := resp.GetBody().GetObjectPart().(*objectV2.GetObjectPartInit); ok { + if v, ok := resp.GetBody().GetObjectPart().(*objectV2.GetResponse_Body_Init_); ok { oV2 := new(objectV2.Object) - oV2.SetObjectID(v.GetObjectID()) - oV2.SetHeader(v.GetHeader()) + oV2.SetObjectId(v.Init.GetObjectId()) + oV2.SetHeader(v.Init.GetHeader()) dst.objectHeaders = headersFromObject(objectSDK.NewFromV2(oV2), h.cnr, h.obj) } @@ -178,21 +178,21 @@ func (h *cfg) readObjectHeadersResponseXHeaderSource(m responseXHeaderSource, ds var hdr *objectV2.Header - switch v := resp.GetBody().GetHeaderPart().(type) { - case *objectV2.ShortHeader: + switch v := resp.GetBody().GetHead().(type) { + case *objectV2.HeadResponse_Body_ShortHeader: hdr = new(objectV2.Header) var idV2 refsV2.ContainerID h.cnr.WriteToV2(&idV2) - hdr.SetContainerID(&idV2) - hdr.SetVersion(v.GetVersion()) - hdr.SetCreationEpoch(v.GetCreationEpoch()) - hdr.SetOwnerID(v.GetOwnerID()) - hdr.SetObjectType(v.GetObjectType()) - hdr.SetPayloadLength(v.GetPayloadLength()) - case *objectV2.HeaderWithSignature: - hdr = v.GetHeader() + hdr.SetContainerId(&idV2) + hdr.SetVersion(v.ShortHeader.GetVersion()) + hdr.SetCreationEpoch(v.ShortHeader.GetCreationEpoch()) + hdr.SetOwnerId(v.ShortHeader.GetOwnerId()) + hdr.SetObjectType(v.ShortHeader.GetObjectType()) + hdr.SetPayloadLength(v.ShortHeader.GetPayloadLength()) + case *objectV2.HeadResponse_Body_Header: + hdr = v.Header.GetHeader() } oV2.SetHeader(hdr) diff --git a/pkg/services/object/acl/eacl/v2/object.go b/pkg/services/object/acl/eacl/v2/object.go index 690e4aa70..cd70b6136 100644 --- a/pkg/services/object/acl/eacl/v2/object.go +++ b/pkg/services/object/acl/eacl/v2/object.go @@ -14,11 +14,11 @@ type sysObjHdr struct { k, v string } -func (s sysObjHdr) Key() string { +func (s sysObjHdr) GetKey() string { return s.k } -func (s sysObjHdr) Value() string { +func (s sysObjHdr) GetValue() string { return s.v } diff --git a/pkg/services/object/acl/eacl/v2/xheader.go b/pkg/services/object/acl/eacl/v2/xheader.go index 246714af7..a2c58744e 100644 --- a/pkg/services/object/acl/eacl/v2/xheader.go +++ b/pkg/services/object/acl/eacl/v2/xheader.go @@ -1,7 +1,7 @@ package v2 import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" eaclSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl" ) @@ -30,7 +30,7 @@ func (s requestXHeaderSource) GetXHeaders() []eaclSDK.Header { for meta := s.req.GetMetaHeader(); meta != nil; meta = meta.GetOrigin() { x := meta.GetXHeaders() for i := range x { - res = append(res, (xHeader)(x[i])) + res = append(res, (*xHeader)(x[i])) } } @@ -39,7 +39,7 @@ func (s requestXHeaderSource) GetXHeaders() []eaclSDK.Header { func (s responseXHeaderSource) GetXHeaders() []eaclSDK.Header { ln := 0 - xHdrs := make([][]session.XHeader, 0) + xHdrs := make([][]*sessionGRPC.XHeader, 0) for meta := s.req.GetMetaHeader(); meta != nil; meta = meta.GetOrigin() { x := meta.GetXHeaders() @@ -53,7 +53,7 @@ func (s responseXHeaderSource) GetXHeaders() []eaclSDK.Header { for i := range xHdrs { for j := range xHdrs[i] { - res = append(res, xHeader(xHdrs[i][j])) + res = append(res, (*xHeader)(xHdrs[i][j])) } } diff --git a/pkg/services/object/acl/v2/errors.go b/pkg/services/object/acl/v2/errors.go index 70c1ae991..95cb7611a 100644 --- a/pkg/services/object/acl/v2/errors.go +++ b/pkg/services/object/acl/v2/errors.go @@ -25,14 +25,14 @@ const accessDeniedACLReasonFmt = "access to operation %s is denied by basic ACL const accessDeniedEACLReasonFmt = "access to operation %s is denied by extended ACL check: %v" func basicACLErr(info RequestInfo) error { - var errAccessDenied apistatus.ObjectAccessDenied + errAccessDenied := apistatus.NewObjectAccessDenied() errAccessDenied.WriteReason(fmt.Sprintf(accessDeniedACLReasonFmt, info.operation)) return errAccessDenied } func eACLErr(info RequestInfo, err error) error { - var errAccessDenied apistatus.ObjectAccessDenied + errAccessDenied := apistatus.NewObjectAccessDenied() errAccessDenied.WriteReason(fmt.Sprintf(accessDeniedEACLReasonFmt, info.operation, err)) return errAccessDenied diff --git a/pkg/services/object/acl/v2/request.go b/pkg/services/object/acl/v2/request.go index 675768969..3ee16635b 100644 --- a/pkg/services/object/acl/v2/request.go +++ b/pkg/services/object/acl/v2/request.go @@ -4,7 +4,7 @@ import ( "crypto/ecdsa" "fmt" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/pkg/services/object/acl/v2/service.go b/pkg/services/object/acl/v2/service.go index c75bd326f..ea1c15f3e 100644 --- a/pkg/services/object/acl/v2/service.go +++ b/pkg/services/object/acl/v2/service.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + objectgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + sessiongrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" @@ -111,7 +111,7 @@ func New(opts ...Option) Service { // Get implements ServiceServer interface, makes ACL checks and calls // next Get method in the ServiceServer pipeline. -func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream) error { +func (b Service) Get(request *objectgrpc.GetRequest, stream object.GetObjectStream) error { cnr, err := getContainerIDFromRequest(request) if err != nil { return err @@ -140,7 +140,7 @@ func (b Service) Get(request *objectV2.GetRequest, stream object.GetObjectStream } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -177,7 +177,7 @@ func (b Service) Put() (object.PutObjectStream, error) { func (b Service) Head( ctx context.Context, - request *objectV2.HeadRequest) (*objectV2.HeadResponse, error) { + request *objectgrpc.HeadRequest) (*objectgrpc.HeadResponse, error) { cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -206,7 +206,7 @@ func (b Service) Head( } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -235,7 +235,7 @@ func (b Service) Head( return resp, err } -func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStream) error { +func (b Service) Search(request *objectgrpc.SearchRequest, stream object.SearchStream) error { id, err := getContainerIDFromRequest(request) if err != nil { return err @@ -259,7 +259,7 @@ func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStr } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -285,7 +285,7 @@ func (b Service) Search(request *objectV2.SearchRequest, stream object.SearchStr func (b Service) Delete( ctx context.Context, - request *objectV2.DeleteRequest) (*objectV2.DeleteResponse, error) { + request *objectgrpc.DeleteRequest) (*objectgrpc.DeleteResponse, error) { cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -314,7 +314,7 @@ func (b Service) Delete( } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -336,7 +336,7 @@ func (b Service) Delete( return b.next.Delete(ctx, request) } -func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetObjectRangeStream) error { +func (b Service) GetRange(request *objectgrpc.GetRangeRequest, stream object.GetObjectRangeStream) error { cnr, err := getContainerIDFromRequest(request) if err != nil { return err @@ -365,7 +365,7 @@ func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetOb } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -393,7 +393,7 @@ func (b Service) GetRange(request *objectV2.GetRangeRequest, stream object.GetOb func (b Service) GetRangeHash( ctx context.Context, - request *objectV2.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error) { + request *objectgrpc.GetRangeHashRequest) (*objectgrpc.GetRangeHashResponse, error) { cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err @@ -422,7 +422,7 @@ func (b Service) GetRangeHash( } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -444,25 +444,25 @@ func (b Service) GetRangeHash( return b.next.GetRangeHash(ctx, request) } -func (b Service) PutSingle(ctx context.Context, request *objectV2.PutSingleRequest) (*objectV2.PutSingleResponse, error) { +func (b Service) PutSingle(ctx context.Context, request *objectgrpc.PutSingleRequest) (*objectgrpc.PutSingleResponse, error) { cnr, err := getContainerIDFromRequest(request) if err != nil { return nil, err } - idV2 := request.GetBody().GetObject().GetHeader().GetOwnerID() + idV2 := request.GetBody().GetObject().GetHeader().GetOwnerId() if idV2 == nil { return nil, errors.New("missing object owner") } var idOwner user.ID - err = idOwner.ReadFromV2(*idV2) + err = idOwner.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid object owner: %w", err) } - obj, err := getObjectIDFromRefObjectID(request.GetBody().GetObject().GetObjectID()) + obj, err := getObjectIDFromRefObjectID(request.GetBody().GetObject().GetObjectId()) if err != nil { return nil, err } @@ -479,7 +479,7 @@ func (b Service) PutSingle(ctx context.Context, request *objectV2.PutSingleReque } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -503,38 +503,38 @@ func (b Service) PutSingle(ctx context.Context, request *objectV2.PutSingleReque return b.next.PutSingle(ctx, request) } -func (p putStreamBasicChecker) Send(ctx context.Context, request *objectV2.PutRequest) error { +func (p putStreamBasicChecker) Send(ctx context.Context, request *objectgrpc.PutRequest) error { body := request.GetBody() if body == nil { return errEmptyBody } part := body.GetObjectPart() - if part, ok := part.(*objectV2.PutObjectPartInit); ok { + if part, ok := part.(*objectgrpc.PutRequest_Body_Init_); ok { cnr, err := getContainerIDFromRequest(request) if err != nil { return err } - idV2 := part.GetHeader().GetOwnerID() + idV2 := part.Init.GetHeader().GetOwnerId() if idV2 == nil { return errors.New("missing object owner") } var idOwner user.ID - err = idOwner.ReadFromV2(*idV2) + err = idOwner.ReadFromV2(idV2) if err != nil { return fmt.Errorf("invalid object owner: %w", err) } - objV2 := part.GetObjectID() + objV2 := part.Init.GetObjectId() var obj *oid.ID if objV2 != nil { obj = new(oid.ID) - err = obj.ReadFromV2(*objV2) + err = obj.ReadFromV2(objV2) if err != nil { return err } @@ -552,7 +552,7 @@ func (p putStreamBasicChecker) Send(ctx context.Context, request *objectV2.PutRe } req := MetaWithToken{ - vheader: request.GetVerificationHeader(), + vheader: request.GetVerifyHeader(), token: sTok, bearer: bTok, src: request, @@ -575,13 +575,13 @@ func (p putStreamBasicChecker) Send(ctx context.Context, request *objectV2.PutRe return p.next.Send(ctx, request) } -func readSessionToken(cnr cid.ID, obj *oid.ID, tokV2 *session.Token) (*sessionSDK.Object, error) { +func readSessionToken(cnr cid.ID, obj *oid.ID, tokV2 *sessiongrpc.SessionToken) (*sessionSDK.Object, error) { var sTok *sessionSDK.Object if tokV2 != nil { sTok = new(sessionSDK.Object) - err := sTok.ReadFromV2(*tokV2) + err := sTok.ReadFromV2(tokV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } @@ -603,12 +603,12 @@ func readSessionToken(cnr cid.ID, obj *oid.ID, tokV2 *session.Token) (*sessionSD return sTok, nil } -func (p putStreamBasicChecker) CloseAndRecv(ctx context.Context) (*objectV2.PutResponse, error) { +func (p putStreamBasicChecker) CloseAndRecv(ctx context.Context) (*objectgrpc.PutResponse, error) { return p.next.CloseAndRecv(ctx) } -func (g *getStreamBasicChecker) Send(resp *objectV2.GetResponse) error { - if _, ok := resp.GetBody().GetObjectPart().(*objectV2.GetObjectPartInit); ok { +func (g *getStreamBasicChecker) Send(resp *objectgrpc.GetResponse) error { + if _, ok := resp.GetBody().GetObjectPart().(*objectgrpc.GetResponse_Body_Init_); ok { if err := g.checker.CheckEACL(resp, g.info); err != nil { return eACLErr(g.info, err) } @@ -617,7 +617,7 @@ func (g *getStreamBasicChecker) Send(resp *objectV2.GetResponse) error { return g.GetObjectStream.Send(resp) } -func (g *rangeStreamBasicChecker) Send(resp *objectV2.GetRangeResponse) error { +func (g *rangeStreamBasicChecker) Send(resp *objectgrpc.GetRangeResponse) error { if err := g.checker.CheckEACL(resp, g.info); err != nil { return eACLErr(g.info, err) } @@ -625,7 +625,7 @@ func (g *rangeStreamBasicChecker) Send(resp *objectV2.GetRangeResponse) error { return g.GetObjectRangeStream.Send(resp) } -func (g *searchStreamBasicChecker) Send(resp *objectV2.SearchResponse) error { +func (g *searchStreamBasicChecker) Send(resp *objectgrpc.SearchResponse) error { if err := g.checker.CheckEACL(resp, g.info); err != nil { return eACLErr(g.info, err) } @@ -645,7 +645,7 @@ func (b Service) findRequestInfo(req MetaWithToken, idCnr cid.ID, op acl.Op) (in return info, errors.New("can't fetch current epoch") } if req.token.ExpiredAt(currentEpoch) { - return info, apistatus.SessionTokenExpired{} + return info, apistatus.NewSessionTokenExpired() } if req.token.InvalidAt(currentEpoch) { return info, fmt.Errorf("%s: token is invalid at %d epoch)", diff --git a/pkg/services/object/acl/v2/util.go b/pkg/services/object/acl/v2/util.go index feda6a3cf..8ef50ac70 100644 --- a/pkg/services/object/acl/v2/util.go +++ b/pkg/services/object/acl/v2/util.go @@ -6,9 +6,9 @@ import ( "errors" "fmt" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" @@ -26,26 +26,26 @@ func getContainerIDFromRequest(req any) (cid.ID, error) { switch v := req.(type) { case *objectV2.GetRequest: - idV2 = v.GetBody().GetAddress().GetContainerID() + idV2 = v.GetBody().GetAddress().GetContainerId() case *objectV2.PutRequest: - part, ok := v.GetBody().GetObjectPart().(*objectV2.PutObjectPartInit) + part, ok := v.GetBody().GetObjectPart().(*objectV2.PutRequest_Body_Init_) if !ok { return cid.ID{}, errors.New("can't get container ID in chunk") } - idV2 = part.GetHeader().GetContainerID() + idV2 = part.Init.GetHeader().GetContainerId() case *objectV2.HeadRequest: - idV2 = v.GetBody().GetAddress().GetContainerID() + idV2 = v.GetBody().GetAddress().GetContainerId() case *objectV2.SearchRequest: - idV2 = v.GetBody().GetContainerID() + idV2 = v.GetBody().GetContainerId() case *objectV2.DeleteRequest: - idV2 = v.GetBody().GetAddress().GetContainerID() + idV2 = v.GetBody().GetAddress().GetContainerId() case *objectV2.GetRangeRequest: - idV2 = v.GetBody().GetAddress().GetContainerID() + idV2 = v.GetBody().GetAddress().GetContainerId() case *objectV2.GetRangeHashRequest: - idV2 = v.GetBody().GetAddress().GetContainerID() + idV2 = v.GetBody().GetAddress().GetContainerId() case *objectV2.PutSingleRequest: - idV2 = v.GetBody().GetObject().GetHeader().GetContainerID() + idV2 = v.GetBody().GetObject().GetHeader().GetContainerId() default: return cid.ID{}, errors.New("unknown request type") } @@ -54,7 +54,7 @@ func getContainerIDFromRequest(req any) (cid.ID, error) { return cid.ID{}, errMissingContainerID } - return id, id.ReadFromV2(*idV2) + return id, id.ReadFromV2(idV2) } // originalBearerToken goes down to original request meta header and fetches @@ -69,8 +69,8 @@ func originalBearerToken(header *sessionV2.RequestMetaHeader) (*bearer.Token, er return nil, nil } - var tok bearer.Token - return &tok, tok.ReadFromV2(*tokV2) + tok := bearer.NewToken() + return &tok, tok.ReadFromV2(tokV2) } // originalSessionToken goes down to original request meta header and fetches @@ -85,20 +85,20 @@ func originalSessionToken(header *sessionV2.RequestMetaHeader) (*sessionSDK.Obje return nil, nil } - var tok sessionSDK.Object + tok := sessionSDK.NewObject() - err := tok.ReadFromV2(*tokV2) + err := tok.ReadFromV2(tokV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } - return &tok, nil + return tok, nil } // getObjectIDFromRequestBody decodes oid.ID from the common interface of the // object reference's holders. Returns an error if object ID is missing in the request. func getObjectIDFromRequestBody(body interface{ GetAddress() *refsV2.Address }) (*oid.ID, error) { - idV2 := body.GetAddress().GetObjectID() + idV2 := body.GetAddress().GetObjectId() return getObjectIDFromRefObjectID(idV2) } @@ -109,7 +109,7 @@ func getObjectIDFromRefObjectID(idV2 *refsV2.ObjectID) (*oid.ID, error) { var id oid.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, err } @@ -124,8 +124,8 @@ func ownerFromToken(token *sessionSDK.Object) (*user.ID, *keys.PublicKey, error) } // 2. Then check if session token owner issued the session token - // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion - var tokV2 sessionV2.Token + // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + var tokV2 sessionV2.SessionToken token.WriteToV2(&tokV2) tokenIssuerKey, err := unmarshalPublicKey(tokV2.GetSignature().GetKey()) diff --git a/pkg/services/object/acl/v2/util_test.go b/pkg/services/object/acl/v2/util_test.go index 394feef4e..12581f176 100644 --- a/pkg/services/object/acl/v2/util_test.go +++ b/pkg/services/object/acl/v2/util_test.go @@ -6,8 +6,8 @@ import ( "crypto/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" bearertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer/test" aclsdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test" @@ -24,13 +24,13 @@ func TestOriginalTokens(t *testing.T) { pk, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) require.NoError(t, bToken.Sign(*pk)) - var bTokenV2 acl.BearerToken + var bTokenV2 aclGRPC.BearerToken bToken.WriteToV2(&bTokenV2) // This line is needed because SDK uses some custom format for // reserved filters, so `cid.ID` is not converted to string immediately. - require.NoError(t, bToken.ReadFromV2(bTokenV2)) + require.NoError(t, bToken.ReadFromV2(&bTokenV2)) - var sTokenV2 session.Token + var sTokenV2 sessionGRPC.SessionToken sToken.WriteToV2(&sTokenV2) for i := 0; i < 10; i++ { @@ -45,14 +45,14 @@ func TestOriginalTokens(t *testing.T) { } } -func testGenerateMetaHeader(depth uint32, b *acl.BearerToken, s *session.Token) *session.RequestMetaHeader { - metaHeader := new(session.RequestMetaHeader) +func testGenerateMetaHeader(depth uint32, b *aclGRPC.BearerToken, s *sessionGRPC.SessionToken) *sessionGRPC.RequestMetaHeader { + metaHeader := new(sessionGRPC.RequestMetaHeader) metaHeader.SetBearerToken(b) metaHeader.SetSessionToken(s) for i := uint32(0); i < depth; i++ { link := metaHeader - metaHeader = new(session.RequestMetaHeader) + metaHeader = new(sessionGRPC.RequestMetaHeader) metaHeader.SetOrigin(link) } @@ -87,7 +87,7 @@ func TestIsVerbCompatible(t *testing.T) { sessionSDK.VerbObjectSearch, } - var tok sessionSDK.Object + tok := *sessionSDK.NewObject() for op, list := range table { for _, verb := range verbs { @@ -108,7 +108,7 @@ func TestIsVerbCompatible(t *testing.T) { } func TestAssertSessionRelation(t *testing.T) { - var tok sessionSDK.Object + tok := *sessionSDK.NewObject() cnr := cidtest.ID() cnrOther := cidtest.ID() obj := oidtest.ID() diff --git a/pkg/services/object/common.go b/pkg/services/object/common.go index 0d39dce0b..4ad1d9f5b 100644 --- a/pkg/services/object/common.go +++ b/pkg/services/object/common.go @@ -3,7 +3,7 @@ package object import ( "context" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) @@ -32,7 +32,7 @@ func (x *Common) Init(state NodeState, nextHandler ServiceServer) { x.nextHandler = nextHandler } -var errMaintenance apistatus.NodeUnderMaintenance +var errMaintenance = apistatus.NewNodeUnderMaintenance() func (x *Common) Get(req *objectV2.GetRequest, stream GetObjectStream) error { if x.state.IsMaintenance() { diff --git a/pkg/services/object/delete/exec.go b/pkg/services/object/delete/exec.go index b10f045ee..6f656b638 100644 --- a/pkg/services/object/delete/exec.go +++ b/pkg/services/object/delete/exec.go @@ -256,11 +256,11 @@ func (exec *execCtx) initTombstoneObject() bool { exec.tombstoneObj.SetOwnerID(&localUser) } - var a objectSDK.Attribute + a := objectSDK.NewAttribute() a.SetKey(objectV2.SysAttributeExpEpoch) a.SetValue(strconv.FormatUint(exec.tombstone.ExpirationEpoch(), 10)) - exec.tombstoneObj.SetAttributes(a) + exec.tombstoneObj.SetAttributes(*a) return true } diff --git a/pkg/services/object/delete/v2/service.go b/pkg/services/object/delete/v2/service.go index 51759c5df..7549c1778 100644 --- a/pkg/services/object/delete/v2/service.go +++ b/pkg/services/object/delete/v2/service.go @@ -3,7 +3,7 @@ package deletesvc import ( "context" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" deletesvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/delete" ) @@ -36,7 +36,7 @@ func NewService(opts ...Option) *Service { func (s *Service) Delete(ctx context.Context, req *objectV2.DeleteRequest) (*objectV2.DeleteResponse, error) { resp := new(objectV2.DeleteResponse) - body := new(objectV2.DeleteResponseBody) + body := new(objectV2.DeleteResponse_Body) resp.SetBody(body) p, err := s.toPrm(req, body) diff --git a/pkg/services/object/delete/v2/util.go b/pkg/services/object/delete/v2/util.go index d0db1f543..7ddff0e1c 100644 --- a/pkg/services/object/delete/v2/util.go +++ b/pkg/services/object/delete/v2/util.go @@ -4,18 +4,18 @@ import ( "errors" "fmt" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" deletesvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/delete" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) type tombstoneBodyWriter struct { - body *objectV2.DeleteResponseBody + body *objectV2.DeleteResponse_Body } -func (s *Service) toPrm(req *objectV2.DeleteRequest, respBody *objectV2.DeleteResponseBody) (*deletesvc.Prm, error) { +func (s *Service) toPrm(req *objectV2.DeleteRequest, respBody *objectV2.DeleteResponse_Body) (*deletesvc.Prm, error) { body := req.GetBody() addrV2 := body.GetAddress() @@ -25,7 +25,7 @@ func (s *Service) toPrm(req *objectV2.DeleteRequest, respBody *objectV2.DeleteRe var addr oid.Address - err := addr.ReadFromV2(*addrV2) + err := addr.ReadFromV2(addrV2) if err != nil { return nil, fmt.Errorf("invalid object address: %w", err) } @@ -47,7 +47,7 @@ func (s *Service) toPrm(req *objectV2.DeleteRequest, respBody *objectV2.DeleteRe } func (w *tombstoneBodyWriter) SetAddress(addr oid.Address) { - var addrV2 refs.Address + var addrV2 refsGRPC.Address addr.WriteToV2(&addrV2) w.body.SetTombstone(&addrV2) diff --git a/pkg/services/object/get/assemble.go b/pkg/services/object/get/assemble.go index 777822ac3..03bf700ce 100644 --- a/pkg/services/object/get/assemble.go +++ b/pkg/services/object/get/assemble.go @@ -61,10 +61,10 @@ func (r *request) assemble(ctx context.Context) { } var errSplitInfo *objectSDK.SplitInfoError - var errRemovedRemote *apistatus.ObjectAlreadyRemoved - var errOutOfRangeRemote *apistatus.ObjectOutOfRange - var errRemovedLocal apistatus.ObjectAlreadyRemoved - var errOutOfRangeLocal apistatus.ObjectOutOfRange + errRemovedRemote := apistatus.NewObjectAlreadyRemoved() + errOutOfRangeRemote := apistatus.NewObjectOutOfRange() + errRemovedLocal := apistatus.NewObjectAlreadyRemoved() + errOutOfRangeLocal := apistatus.NewObjectOutOfRange() switch { default: diff --git a/pkg/services/object/get/assembler.go b/pkg/services/object/get/assembler.go index 321d4b16d..3b443f923 100644 --- a/pkg/services/object/get/assembler.go +++ b/pkg/services/object/get/assembler.go @@ -98,7 +98,7 @@ func (a *assembler) initializeFromSourceObjectID(ctx context.Context, id oid.ID) parentSize := parentObject.PayloadSize() if seekTo < seekOff || parentSize < seekOff || parentSize < seekTo { - return nil, nil, &apistatus.ObjectOutOfRange{} + return nil, nil, apistatus.NewObjectOutOfRange() } sourceSize := sourceObject.PayloadSize() @@ -261,7 +261,7 @@ func (a *assembler) buildChain(ctx context.Context, prevID oid.ID) ([]oid.ID, [] } index := len(rngs) - rngs = append(rngs, objectSDK.Range{}) + rngs = append(rngs, *objectSDK.NewRange()) rngs[index].SetOffset(off) rngs[index].SetLength(sz) diff --git a/pkg/services/object/get/get_test.go b/pkg/services/object/get/get_test.go index 9c5506064..edad9037e 100644 --- a/pkg/services/object/get/get_test.go +++ b/pkg/services/object/get/get_test.go @@ -128,7 +128,7 @@ func (c *testClient) addResult(addr oid.Address, obj *objectSDK.Object, err erro func (c *testClient) Get(ctx context.Context, address oid.Address, requestParams RemoteRequestParams) (*objectSDK.Object, error) { v, ok := c.results[address.EncodeToString()] if !ok { - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() return nil, errNotFound } @@ -185,7 +185,7 @@ func (s *testStorage) Range(_ context.Context, address oid.Address, rng *objectS return cutToRange(obj, rng), nil } - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() return nil, errNotFound } @@ -340,7 +340,7 @@ func TestGetLocalOnly(t *testing.T) { require.NoError(t, err) - require.Equal(t, obj, w.Object()) + require.True(t, obj.Equal(w.Object())) w = NewSimpleObjectWriter() @@ -472,7 +472,7 @@ func testNodeMatrix(t testing.TB, dim []int) ([][]netmap.NodeInfo, [][]string) { strconv.Itoa(60000+j), ) - var ni netmap.NodeInfo + ni := netmap.NewNodeInfo() ni.SetNetworkEndpoints(a) var na network.AddressGroup @@ -530,7 +530,7 @@ func generateChain(ln int, cnr cid.ID) ([]*objectSDK.Object, []oid.ID, []byte) { func TestGetRemoteSmall(t *testing.T) { ctx := context.Background() - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(netmaptest.PlacementPolicy()) var idCnr cid.ID @@ -564,7 +564,9 @@ func TestGetRemoteSmall(t *testing.T) { } newRngPrm := func(raw bool, w ChunkWriter, off, ln uint64) RangePrm { - p := RangePrm{} + p := RangePrm{ + rng: objectSDK.NewRange(), + } p.SetChunkWriter(w) p.WithRawFlag(raw) p.common = new(util.CommonPrm).WithLocalOnly(false) @@ -625,13 +627,13 @@ func TestGetRemoteSmall(t *testing.T) { err := svc.Get(ctx, p) require.NoError(t, err) - require.Equal(t, obj, w.Object()) + require.True(t, obj.Equal(w.Object())) *c1, *c2 = *c2, *c1 err = svc.Get(ctx, p) require.NoError(t, err) - require.Equal(t, obj, w.Object()) + require.True(t, obj.Equal(w.Object())) w = NewSimpleObjectWriter() rngPrm := newRngPrm(false, w, payloadSz/3, payloadSz/3) @@ -768,11 +770,11 @@ func TestGetRemoteSmall(t *testing.T) { c1 := newTestClient() c1.addResult(addr, nil, errors.New("any error")) - c1.addResult(splitAddr, nil, apistatus.ObjectNotFound{}) + c1.addResult(splitAddr, nil, apistatus.NewObjectNotFound()) c2 := newTestClient() c2.addResult(addr, nil, objectSDK.NewSplitInfoError(splitInfo)) - c2.addResult(splitAddr, nil, apistatus.ObjectNotFound{}) + c2.addResult(splitAddr, nil, apistatus.NewObjectNotFound()) builder := &testPlacementBuilder{ vectors: map[string][][]netmap.NodeInfo{ @@ -845,7 +847,7 @@ func TestGetRemoteSmall(t *testing.T) { c2.addResult(addr, nil, objectSDK.NewSplitInfoError(splitInfo)) c2.addResult(linkAddr, linkingObj, nil) c2.addResult(child1Addr, children[0], nil) - c2.addResult(child2Addr, nil, apistatus.ObjectNotFound{}) + c2.addResult(child2Addr, nil, apistatus.NewObjectNotFound()) builder := &testPlacementBuilder{ vectors: map[string][][]netmap.NodeInfo{ @@ -949,7 +951,7 @@ func TestGetRemoteSmall(t *testing.T) { err := svc.Get(ctx, p) require.NoError(t, err) - require.Equal(t, srcObj, w.Object()) + require.True(t, srcObj.Equal(w.Object())) w = NewSimpleObjectWriter() payloadSz := srcObj.PayloadSize() @@ -1315,11 +1317,11 @@ func TestGetRemoteSmall(t *testing.T) { c1 := newTestClient() c1.addResult(addr, nil, errors.New("any error")) - c1.addResult(splitAddr, nil, apistatus.ObjectNotFound{}) + c1.addResult(splitAddr, nil, apistatus.NewObjectNotFound()) c2 := newTestClient() c2.addResult(addr, nil, objectSDK.NewSplitInfoError(splitInfo)) - c2.addResult(splitAddr, nil, apistatus.ObjectNotFound{}) + c2.addResult(splitAddr, nil, apistatus.NewObjectNotFound()) builder := &testPlacementBuilder{ vectors: map[string][][]netmap.NodeInfo{ @@ -1403,7 +1405,7 @@ func TestGetRemoteSmall(t *testing.T) { testHeadVirtual(svc, addr, splitInfo) headSvc := newTestClient() - headSvc.addResult(preRightAddr, nil, apistatus.ObjectNotFound{}) + headSvc.addResult(preRightAddr, nil, apistatus.NewObjectNotFound()) p := newPrm(false, NewSimpleObjectWriter()) p.WithAddress(addr) @@ -1568,7 +1570,7 @@ func TestGetRemoteSmall(t *testing.T) { err := svc.Get(ctx, p) require.NoError(t, err) - require.Equal(t, srcObj, w.Object()) + require.True(t, srcObj.Equal(w.Object())) w = NewSimpleObjectWriter() payloadSz := srcObj.PayloadSize() @@ -1640,7 +1642,7 @@ func TestGetRemoteSmall(t *testing.T) { func TestGetFromPastEpoch(t *testing.T) { ctx := context.Background() - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(netmaptest.PlacementPolicy()) var idCnr cid.ID @@ -1717,7 +1719,7 @@ func TestGetFromPastEpoch(t *testing.T) { err = svc.Get(ctx, p) require.NoError(t, err) - require.Equal(t, obj, w.Object()) + require.True(t, obj.Equal(w.Object())) rp := RangePrm{} rp.SetChunkWriter(w) @@ -1759,5 +1761,5 @@ func TestGetFromPastEpoch(t *testing.T) { err = svc.Head(ctx, hp) require.NoError(t, err) - require.Equal(t, obj.CutPayload(), w.Object()) + require.True(t, obj.CutPayload().Equal(w.Object())) } diff --git a/pkg/services/object/get/local.go b/pkg/services/object/get/local.go index 03ede58cc..bed208935 100644 --- a/pkg/services/object/get/local.go +++ b/pkg/services/object/get/local.go @@ -22,8 +22,8 @@ func (r *request) executeLocal(ctx context.Context) { r.collectedObject, err = r.get(ctx) var errSplitInfo *objectSDK.SplitInfoError - var errRemoved apistatus.ObjectAlreadyRemoved - var errOutOfRange apistatus.ObjectOutOfRange + errRemoved := apistatus.NewObjectAlreadyRemoved() + errOutOfRange := apistatus.NewObjectOutOfRange() switch { default: diff --git a/pkg/services/object/get/remote.go b/pkg/services/object/get/remote.go index e3464f941..6dbbc5edd 100644 --- a/pkg/services/object/get/remote.go +++ b/pkg/services/object/get/remote.go @@ -26,12 +26,12 @@ func (r *request) processNode(ctx context.Context, info client.NodeInfo) bool { obj, err := r.getRemote(ctx, rs, info) var errSplitInfo *objectSDK.SplitInfoError - var errRemoved *apistatus.ObjectAlreadyRemoved - var errOutOfRange *apistatus.ObjectOutOfRange + errRemoved := apistatus.NewObjectAlreadyRemoved() + errOutOfRange := apistatus.NewObjectOutOfRange() switch { default: - var errNotFound apistatus.ObjectNotFound + errNotFound := apistatus.NewObjectNotFound() r.status = statusUndefined r.err = errNotFound diff --git a/pkg/services/object/get/types.go b/pkg/services/object/get/types.go index a866132cc..f2dd83ce0 100644 --- a/pkg/services/object/get/types.go +++ b/pkg/services/object/get/types.go @@ -134,7 +134,7 @@ func (s *multiaddressRemoteStorage) ForwardRequest(ctx context.Context, info cor } func (s *multiaddressRemoteStorage) Range(ctx context.Context, address oid.Address, rng *objectSDK.Range, requestParams RemoteRequestParams) (*objectSDK.Object, error) { - var prm internalclient.PayloadRangePrm + prm := internalclient.NewPayloadRangePrm() prm.SetClient(s.client) prm.SetTTL(requestParams.TTL) @@ -163,7 +163,7 @@ func (s *multiaddressRemoteStorage) Range(ctx context.Context, address oid.Addre to := from + rng.GetLength() if pLen := uint64(len(payload)); to < from || pLen < from || pLen < to { - return nil, new(apistatus.ObjectOutOfRange) + return nil, apistatus.NewObjectOutOfRange() } return s.payloadOnlyObject(payload[from:to]), nil @@ -175,7 +175,7 @@ func (s *multiaddressRemoteStorage) Range(ctx context.Context, address oid.Addre } func (s *multiaddressRemoteStorage) Head(ctx context.Context, address oid.Address, requestParams RemoteRequestParams) (*objectSDK.Object, error) { - var prm internalclient.HeadObjectPrm + prm := internalclient.NewHeadObjectPrm() prm.SetClient(s.client) prm.SetTTL(requestParams.TTL) diff --git a/pkg/services/object/get/v2/errors.go b/pkg/services/object/get/v2/errors.go index 01b57f1f2..320d996eb 100644 --- a/pkg/services/object/get/v2/errors.go +++ b/pkg/services/object/get/v2/errors.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) var ( @@ -55,7 +55,7 @@ func errReadingResponseFailed(err error) error { return fmt.Errorf("reading the response failed: %w", err) } -func errUnexpectedObjectPart(v objectV2.GetObjectPart) error { +func errUnexpectedObjectPart(v objectV2.GetResponseBodyObjectPart) error { return fmt.Errorf("unexpected object part %T", v) } @@ -71,11 +71,11 @@ func errCouldNotCreateGetRangeStream(err error) error { return fmt.Errorf("could not create Get payload range stream: %w", err) } -func errUnexpectedRangePart(v objectV2.GetRangePart) error { +func errUnexpectedRangePart(v objectV2.GetRangeResponseBodyRangePart) error { return fmt.Errorf("unexpected range type %T", v) } -func errUnexpectedHeaderPart(v objectV2.GetHeaderPart) error { +func errUnexpectedHeaderPart(v objectV2.HeadResponseBodyHead) error { return fmt.Errorf("unexpected header type %T", v) } diff --git a/pkg/services/object/get/v2/get_forwarder.go b/pkg/services/object/get/v2/get_forwarder.go index 40aa3f62e..d6d792ad2 100644 --- a/pkg/services/object/get/v2/get_forwarder.go +++ b/pkg/services/object/get/v2/get_forwarder.go @@ -7,10 +7,10 @@ import ( "io" "sync" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rpcclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -42,8 +42,8 @@ func (f *getRequestForwarder) forwardRequestToNode(ctx context.Context, addr net // once compose and resign forwarding request f.OnceResign.Do(func() { // compose meta header of the local server - metaHdr := new(session.RequestMetaHeader) - metaHdr.SetTTL(f.Request.GetMetaHeader().GetTTL() - 1) + metaHdr := new(sessionGRPC.RequestMetaHeader) + metaHdr.SetTtl(f.Request.GetMetaHeader().GetTtl() - 1) // TODO: #1165 think how to set the other fields metaHdr.SetOrigin(f.Request.GetMetaHeader()) writeCurrentVersion(metaHdr) @@ -76,10 +76,10 @@ func (f *getRequestForwarder) verifyResponse(resp *objectV2.GetResponse, pubkey return checkStatus(resp.GetMetaHeader().GetStatus()) } -func (f *getRequestForwarder) writeHeader(ctx context.Context, v *objectV2.GetObjectPartInit) error { +func (f *getRequestForwarder) writeHeader(ctx context.Context, v *objectV2.GetResponse_Body_Init) error { obj := new(objectV2.Object) - obj.SetObjectID(v.GetObjectID()) + obj.SetObjectId(v.GetObjectId()) obj.SetSignature(v.GetSignature()) obj.SetHeader(v.GetHeader()) @@ -136,15 +136,15 @@ func (f *getRequestForwarder) readStream(ctx context.Context, c client.MultiAddr switch v := resp.GetBody().GetObjectPart().(type) { default: return errUnexpectedObjectPart(v) - case *objectV2.GetObjectPartInit: + case *objectV2.GetResponse_Body_Init_: if headWas { return errWrongMessageSeq } headWas = true - if err := f.writeHeader(ctx, v); err != nil { + if err := f.writeHeader(ctx, v.Init); err != nil { return err } - case *objectV2.GetObjectPartChunk: + case *objectV2.GetResponse_Body_Chunk: if !headWas { return errWrongMessageSeq } @@ -163,8 +163,8 @@ func (f *getRequestForwarder) readStream(ctx context.Context, c client.MultiAddr localProgress += len(origChunk) f.GlobalProgress += len(chunk) - case *objectV2.SplitInfo: - si := objectSDK.NewSplitInfoFromV2(v) + case *objectV2.GetResponse_Body_SplitInfo: + si := objectSDK.NewSplitInfoFromV2(v.SplitInfo) return objectSDK.NewSplitInfoError(si) } } diff --git a/pkg/services/object/get/v2/get_range_forwarder.go b/pkg/services/object/get/v2/get_range_forwarder.go index 8a56c59a6..d79c07a27 100644 --- a/pkg/services/object/get/v2/get_range_forwarder.go +++ b/pkg/services/object/get/v2/get_range_forwarder.go @@ -7,10 +7,10 @@ import ( "io" "sync" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rpcclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -41,8 +41,8 @@ func (f *getRangeRequestForwarder) forwardRequestToNode(ctx context.Context, add // once compose and resign forwarding request f.OnceResign.Do(func() { // compose meta header of the local server - metaHdr := new(session.RequestMetaHeader) - metaHdr.SetTTL(f.Request.GetMetaHeader().GetTTL() - 1) + metaHdr := new(sessionGRPC.RequestMetaHeader) + metaHdr.SetTtl(f.Request.GetMetaHeader().GetTtl() - 1) // TODO: #1165 think how to set the other fields metaHdr.SetOrigin(f.Request.GetMetaHeader()) writeCurrentVersion(metaHdr) @@ -114,7 +114,7 @@ func (f *getRangeRequestForwarder) readStream(ctx context.Context, rangeStream * switch v := resp.GetBody().GetRangePart().(type) { case nil: return errUnexpectedRangePart(v) - case *objectV2.GetRangePartChunk: + case *objectV2.GetRangeResponse_Body_Chunk: origChunk := v.GetChunk() chunk := chunkToSend(f.GlobalProgress, localProgress, origChunk) @@ -129,8 +129,8 @@ func (f *getRangeRequestForwarder) readStream(ctx context.Context, rangeStream * localProgress += len(origChunk) f.GlobalProgress += len(chunk) - case *objectV2.SplitInfo: - si := objectSDK.NewSplitInfoFromV2(v) + case *objectV2.GetRangeResponse_Body_SplitInfo: + si := objectSDK.NewSplitInfoFromV2(v.SplitInfo) return objectSDK.NewSplitInfoError(si) } } diff --git a/pkg/services/object/get/v2/head_forwarder.go b/pkg/services/object/get/v2/head_forwarder.go index a1bce1517..ddf463acf 100644 --- a/pkg/services/object/get/v2/head_forwarder.go +++ b/pkg/services/object/get/v2/head_forwarder.go @@ -5,11 +5,11 @@ import ( "crypto/ecdsa" "sync" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rpcclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -41,8 +41,8 @@ func (f *headRequestForwarder) forwardRequestToNode(ctx context.Context, addr ne // once compose and resign forwarding request f.OnceResign.Do(func() { // compose meta header of the local server - metaHdr := new(session.RequestMetaHeader) - metaHdr.SetTTL(f.Request.GetMetaHeader().GetTTL() - 1) + metaHdr := new(sessionGRPC.RequestMetaHeader) + metaHdr.SetTtl(f.Request.GetMetaHeader().GetTtl() - 1) // TODO: #1165 think how to set the other fields metaHdr.SetOrigin(f.Request.GetMetaHeader()) writeCurrentVersion(metaHdr) @@ -67,22 +67,22 @@ func (f *headRequestForwarder) forwardRequestToNode(ctx context.Context, addr ne var ( hdr *objectV2.Header - idSig *refs.Signature + idSig *refsGRPC.Signature ) - switch v := headResp.GetBody().GetHeaderPart().(type) { + switch v := headResp.GetBody().GetHead().(type) { case nil: return nil, errUnexpectedHeaderPart(v) - case *objectV2.ShortHeader: - if hdr, err = f.getHeaderFromShortHeader(v); err != nil { + case *objectV2.HeadResponse_Body_ShortHeader: + if hdr, err = f.getHeaderFromShortHeader(v.ShortHeader); err != nil { return nil, err } - case *objectV2.HeaderWithSignature: - if hdr, idSig, err = f.getHeaderAndSignature(v); err != nil { + case *objectV2.HeadResponse_Body_Header: + if hdr, idSig, err = f.getHeaderAndSignature(v.Header); err != nil { return nil, err } - case *objectV2.SplitInfo: - si := objectSDK.NewSplitInfoFromV2(v) + case *objectV2.HeadResponse_Body_SplitInfo: + si := objectSDK.NewSplitInfoFromV2(v.SplitInfo) return nil, objectSDK.NewSplitInfoError(si) } @@ -104,7 +104,7 @@ func (f *headRequestForwarder) getHeaderFromShortHeader(sh *objectV2.ShortHeader hdr := new(objectV2.Header) hdr.SetPayloadLength(sh.GetPayloadLength()) hdr.SetVersion(sh.GetVersion()) - hdr.SetOwnerID(sh.GetOwnerID()) + hdr.SetOwnerId(sh.GetOwnerId()) hdr.SetObjectType(sh.GetObjectType()) hdr.SetCreationEpoch(sh.GetCreationEpoch()) hdr.SetPayloadHash(sh.GetPayloadHash()) @@ -112,7 +112,7 @@ func (f *headRequestForwarder) getHeaderFromShortHeader(sh *objectV2.ShortHeader return hdr, nil } -func (f *headRequestForwarder) getHeaderAndSignature(hdrWithSig *objectV2.HeaderWithSignature) (*objectV2.Header, *refs.Signature, error) { +func (f *headRequestForwarder) getHeaderAndSignature(hdrWithSig *objectV2.HeaderWithSignature) (*objectV2.Header, *refsGRPC.Signature, error) { if f.Request.GetBody().GetMainOnly() { return nil, nil, errWrongHeaderPartTypeExpWithSignRecvShort } @@ -133,8 +133,8 @@ func (f *headRequestForwarder) getHeaderAndSignature(hdrWithSig *objectV2.Header return nil, nil, errMarshalID(err) } - var sig frostfscrypto.Signature - if err := sig.ReadFromV2(*idSig); err != nil { + sig := frostfscrypto.NewSignature() + if err := sig.ReadFromV2(idSig); err != nil { return nil, nil, errCantReadSignature(err) } diff --git a/pkg/services/object/get/v2/service.go b/pkg/services/object/get/v2/service.go index d4bce178a..ef9e55e32 100644 --- a/pkg/services/object/get/v2/service.go +++ b/pkg/services/object/get/v2/service.go @@ -4,7 +4,8 @@ import ( "context" "errors" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" getsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/get" objutil "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" @@ -39,7 +40,7 @@ func NewService(opts ...Option) *Service { } // Get calls internal service and returns v2 object stream. -func (s *Service) Get(req *objectV2.GetRequest, stream objectSvc.GetObjectStream) error { +func (s *Service) Get(req *objectGRPC.GetRequest, stream objectSvc.GetObjectStream) error { p, err := s.toPrm(req, stream) if err != nil { return err @@ -58,7 +59,7 @@ func (s *Service) Get(req *objectV2.GetRequest, stream objectSvc.GetObjectStream } // GetRange calls internal service and returns v2 payload range stream. -func (s *Service) GetRange(req *objectV2.GetRangeRequest, stream objectSvc.GetObjectRangeStream) error { +func (s *Service) GetRange(req *objectGRPC.GetRangeRequest, stream objectSvc.GetObjectRangeStream) error { p, err := s.toRangePrm(req, stream) if err != nil { return err @@ -77,7 +78,7 @@ func (s *Service) GetRange(req *objectV2.GetRangeRequest, stream objectSvc.GetOb } // GetRangeHash calls internal service and returns v2 response. -func (s *Service) GetRangeHash(ctx context.Context, req *objectV2.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error) { +func (s *Service) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error) { p, err := s.toHashRangePrm(req) if err != nil { return nil, err @@ -92,9 +93,9 @@ func (s *Service) GetRangeHash(ctx context.Context, req *objectV2.GetRangeHashRe } // Head serves ForstFS API v2 compatible HEAD requests. -func (s *Service) Head(ctx context.Context, req *objectV2.HeadRequest) (*objectV2.HeadResponse, error) { - resp := new(objectV2.HeadResponse) - resp.SetBody(new(objectV2.HeadResponseBody)) +func (s *Service) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { + resp := new(objectGRPC.HeadResponse) + resp.SetBody(new(objectGRPC.HeadResponse_Body)) p, err := s.toHeadPrm(req, resp) if err != nil { diff --git a/pkg/services/object/get/v2/streamer.go b/pkg/services/object/get/v2/streamer.go index ce9a5c767..525c8f2cc 100644 --- a/pkg/services/object/get/v2/streamer.go +++ b/pkg/services/object/get/v2/streamer.go @@ -3,7 +3,7 @@ package getsvc import ( "context" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" ) @@ -17,31 +17,37 @@ type streamObjectRangeWriter struct { } func (s *streamObjectWriter) WriteHeader(_ context.Context, obj *objectSDK.Object) error { - p := new(objectV2.GetObjectPartInit) + p := new(objectV2.GetResponse_Body_Init_) objV2 := obj.ToV2() - p.SetObjectID(objV2.GetObjectID()) - p.SetHeader(objV2.GetHeader()) - p.SetSignature(objV2.GetSignature()) + p.Init = new(objectV2.GetResponse_Body_Init) + p.Init.SetObjectId(objV2.GetObjectId()) + p.Init.SetHeader(objV2.GetHeader()) + p.Init.SetSignature(objV2.GetSignature()) return s.GetObjectStream.Send(newResponse(p)) } func (s *streamObjectWriter) WriteChunk(_ context.Context, chunk []byte) error { - p := new(objectV2.GetObjectPartChunk) + p := new(objectV2.GetResponse_Body_Chunk) p.SetChunk(chunk) return s.GetObjectStream.Send(newResponse(p)) } -func newResponse(p objectV2.GetObjectPart) *objectV2.GetResponse { +func newResponse(p objectV2.GetResponseBodyObjectPart) *objectV2.GetResponse { r := new(objectV2.GetResponse) - - body := new(objectV2.GetResponseBody) + body := new(objectV2.GetResponse_Body) + if v, ok := p.(*objectV2.GetResponse_Body_Init_); ok { + body.SetInit(v.Init) + } else if v, ok := p.(*objectV2.GetResponse_Body_Chunk); ok { + body.SetChunk(v) + } else if v, ok := p.(*objectV2.GetResponse_Body_SplitInfo); ok { + body.SetSplitInfo(v.SplitInfo) + } else { + panic("unsupported response body part type") + } r.SetBody(body) - - body.SetObjectPart(p) - return r } @@ -52,13 +58,13 @@ func (s *streamObjectRangeWriter) WriteChunk(_ context.Context, chunk []byte) er func newRangeResponse(p []byte) *objectV2.GetRangeResponse { r := new(objectV2.GetRangeResponse) - body := new(objectV2.GetRangeResponseBody) + body := new(objectV2.GetRangeResponse_Body) r.SetBody(body) - part := new(objectV2.GetRangePartChunk) + part := new(objectV2.GetRangeResponse_Body_Chunk) part.SetChunk(p) - body.SetRangePart(part) + body.SetChunk(part) return r } diff --git a/pkg/services/object/get/v2/util.go b/pkg/services/object/get/v2/util.go index 9ecc9167f..611d20e28 100644 --- a/pkg/services/object/get/v2/util.go +++ b/pkg/services/object/get/v2/util.go @@ -6,10 +6,10 @@ import ( "errors" "hash" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + statusGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" @@ -32,7 +32,7 @@ func (s *Service) toPrm(req *objectV2.GetRequest, stream objectSvc.GetObjectStre var addr oid.Address - err := addr.ReadFromV2(*addrV2) + err := addr.ReadFromV2(addrV2) if err != nil { return nil, errInvalidObjAddress(err) } @@ -80,7 +80,7 @@ func (s *Service) toRangePrm(req *objectV2.GetRangeRequest, stream objectSvc.Get var addr oid.Address - err := addr.ReadFromV2(*addrV2) + err := addr.ReadFromV2(addrV2) if err != nil { return nil, errInvalidObjAddress(err) } @@ -134,7 +134,7 @@ func (s *Service) toHashRangePrm(req *objectV2.GetRangeHashRequest) (*getsvc.Ran var addr oid.Address - err := addr.ReadFromV2(*addrV2) + err := addr.ReadFromV2(addrV2) if err != nil { return nil, errInvalidObjAddress(err) } @@ -170,7 +170,7 @@ func (s *Service) toHashRangePrm(req *objectV2.GetRangeHashRequest) (*getsvc.Ran rngs := make([]objectSDK.Range, len(rngsV2)) for i := range rngsV2 { - rngs[i] = *objectSDK.NewRangeFromV2(&rngsV2[i]) + rngs[i] = *objectSDK.NewRangeFromV2(rngsV2[i]) } p.SetRangeList(rngs) @@ -179,11 +179,11 @@ func (s *Service) toHashRangePrm(req *objectV2.GetRangeHashRequest) (*getsvc.Ran switch t := body.GetType(); t { default: return nil, errUnknownChechsumType(t) - case refs.SHA256: + case refsGRPC.ChecksumType_SHA256: p.SetHashGenerator(func() hash.Hash { return sha256.New() }) - case refs.TillichZemor: + case refsGRPC.ChecksumType_TZ: p.SetHashGenerator(func() hash.Hash { return tz.New() }) @@ -195,14 +195,14 @@ func (s *Service) toHashRangePrm(req *objectV2.GetRangeHashRequest) (*getsvc.Ran type headResponseWriter struct { mainOnly bool - body *objectV2.HeadResponseBody + body *objectV2.HeadResponse_Body } func (w *headResponseWriter) WriteHeader(_ context.Context, hdr *objectSDK.Object) error { if w.mainOnly { - w.body.SetHeaderPart(toShortObjectHeader(hdr)) + w.body.SetShortHeader(toShortObjectHeader(hdr)) } else { - w.body.SetHeaderPart(toFullObjectHeader(hdr)) + w.body.SetHeader(toFullObjectHeader(hdr)) } return nil @@ -218,7 +218,7 @@ func (s *Service) toHeadPrm(req *objectV2.HeadRequest, resp *objectV2.HeadRespon var objAddr oid.Address - err := objAddr.ReadFromV2(*addrV2) + err := objAddr.ReadFromV2(addrV2) if err != nil { return nil, errInvalidObjAddress(err) } @@ -262,33 +262,32 @@ func (s *Service) toHeadPrm(req *objectV2.HeadRequest, resp *objectV2.HeadRespon func splitInfoResponse(info *objectSDK.SplitInfo) *objectV2.GetResponse { resp := new(objectV2.GetResponse) - body := new(objectV2.GetResponseBody) + body := new(objectV2.GetResponse_Body) resp.SetBody(body) - body.SetObjectPart(info.ToV2()) - + body.SetSplitInfo(info.ToV2()) return resp } func splitInfoRangeResponse(info *objectSDK.SplitInfo) *objectV2.GetRangeResponse { resp := new(objectV2.GetRangeResponse) - body := new(objectV2.GetRangeResponseBody) + body := new(objectV2.GetRangeResponse_Body) resp.SetBody(body) - body.SetRangePart(info.ToV2()) + body.SetSplitInfo(info.ToV2()) return resp } func setSplitInfoHeadResponse(info *objectSDK.SplitInfo, resp *objectV2.HeadResponse) { - resp.GetBody().SetHeaderPart(info.ToV2()) + resp.GetBody().SetSplitInfo(info.ToV2()) } -func toHashResponse(typ refs.ChecksumType, res *getsvc.RangeHashRes) *objectV2.GetRangeHashResponse { +func toHashResponse(typ refsGRPC.ChecksumType, res *getsvc.RangeHashRes) *objectV2.GetRangeHashResponse { resp := new(objectV2.GetRangeHashResponse) - body := new(objectV2.GetRangeHashResponseBody) + body := new(objectV2.GetRangeHashResponse_Body) resp.SetBody(body) body.SetType(typ) @@ -297,7 +296,7 @@ func toHashResponse(typ refs.ChecksumType, res *getsvc.RangeHashRes) *objectV2.G return resp } -func toFullObjectHeader(hdr *objectSDK.Object) objectV2.GetHeaderPart { +func toFullObjectHeader(hdr *objectSDK.Object) *objectV2.HeaderWithSignature { obj := hdr.ToV2() hs := new(objectV2.HeaderWithSignature) @@ -307,11 +306,11 @@ func toFullObjectHeader(hdr *objectSDK.Object) objectV2.GetHeaderPart { return hs } -func toShortObjectHeader(hdr *objectSDK.Object) objectV2.GetHeaderPart { +func toShortObjectHeader(hdr *objectSDK.Object) *objectV2.ShortHeader { hdrV2 := hdr.ToV2().GetHeader() sh := new(objectV2.ShortHeader) - sh.SetOwnerID(hdrV2.GetOwnerID()) + sh.SetOwnerId(hdrV2.GetOwnerId()) sh.SetCreationEpoch(hdrV2.GetCreationEpoch()) sh.SetPayloadLength(hdrV2.GetPayloadLength()) sh.SetVersion(hdrV2.GetVersion()) @@ -353,8 +352,8 @@ func groupAddressRequestForwarder(f func(context.Context, network.Address, clien } } -func writeCurrentVersion(metaHdr *session.RequestMetaHeader) { - versionV2 := new(refs.Version) +func writeCurrentVersion(metaHdr *sessionGRPC.RequestMetaHeader) { + versionV2 := new(refsGRPC.Version) apiVersion := versionSDK.Current() apiVersion.WriteToV2(versionV2) @@ -362,8 +361,8 @@ func writeCurrentVersion(metaHdr *session.RequestMetaHeader) { metaHdr.SetVersion(versionV2) } -func checkStatus(stV2 *status.Status) error { - if !status.IsSuccess(stV2.Code()) { +func checkStatus(stV2 *statusGRPC.Status) error { + if !statusGRPC.IsSuccess(stV2.GetCode()) { st := apistatus.FromStatusV2(stV2) return apistatus.ErrFromStatus(st) } diff --git a/pkg/services/object/head/remote.go b/pkg/services/object/head/remote.go index c9c17d4d8..5753fa6b5 100644 --- a/pkg/services/object/head/remote.go +++ b/pkg/services/object/head/remote.go @@ -82,7 +82,7 @@ func (h *RemoteHeader) Head(ctx context.Context, prm *RemoteHeadPrm) (*objectSDK return nil, fmt.Errorf("(%T) could not create SDK client %s: %w", h, info.AddressGroup(), err) } - var headPrm internalclient.HeadObjectPrm + headPrm := internalclient.NewHeadObjectPrm() headPrm.SetClient(c) headPrm.SetPrivateKey(key) diff --git a/pkg/services/object/internal/client/client.go b/pkg/services/object/internal/client/client.go index cfab77efe..2a8e85d38 100644 --- a/pkg/services/object/internal/client/client.go +++ b/pkg/services/object/internal/client/client.go @@ -14,6 +14,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" @@ -155,9 +156,9 @@ func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) { return nil, fmt.Errorf("init object reading: %w", err) } - var obj objectSDK.Object + obj := object.New() - if !rdr.ReadHeader(&obj) { + if !rdr.ReadHeader(obj) { res, err := rdr.Close() if err == nil { // pull out an error from status @@ -179,7 +180,7 @@ func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) { obj.SetPayload(buf) return &GetObjectRes{ - obj: &obj, + obj: obj, }, nil } @@ -192,6 +193,12 @@ type HeadObjectPrm struct { obj oid.ID } +func NewHeadObjectPrm() HeadObjectPrm { + return HeadObjectPrm{ + cliPrm: client.NewPrmObjectHead(), + } +} + // SetRawFlag sets raw flag of the request. // // By default request will not be raw. @@ -255,14 +262,14 @@ func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error) return nil, fmt.Errorf("read object header from FrostFS: %w", err) } - var hdr objectSDK.Object + hdr := object.New() - if !cliRes.ReadHeader(&hdr) { + if !cliRes.ReadHeader(hdr) { return nil, errors.New("missing object header in the response") } return &HeadObjectRes{ - hdr: &hdr, + hdr: hdr, }, nil } @@ -277,6 +284,12 @@ type PayloadRangePrm struct { obj oid.ID } +func NewPayloadRangePrm() PayloadRangePrm { + return PayloadRangePrm{ + cliPrm: client.NewPrmObjectRange(), + } +} + // SetRawFlag sets raw flag of the request. // // By default request will not be raw. @@ -354,7 +367,7 @@ func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, e // `CopyN` expects `int64`, this check ensures that the result is positive. // On practice this means that we can return incorrect results for objects // with size > 8_388 Petabytes, this will be fixed later with support for streaming. - return nil, new(apistatus.ObjectOutOfRange) + return nil, apistatus.NewObjectOutOfRange() } ln := prm.ln @@ -406,7 +419,7 @@ func PutObject(ctx context.Context, prm PutObjectPrm) (*PutObjectRes, error) { ctx, span := tracing.StartSpanFromContext(ctx, "client.PutObject") defer span.End() - var prmCli client.PrmObjectPutInit + prmCli := client.NewPrmObjectPutInit() prmCli.MarkLocal() diff --git a/pkg/services/object/internal/key.go b/pkg/services/object/internal/key.go index 7ab5f082c..e03f4bf29 100644 --- a/pkg/services/object/internal/key.go +++ b/pkg/services/object/internal/key.go @@ -3,15 +3,15 @@ package internal import ( "bytes" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" ) // VerifyResponseKeyV2 checks if response is signed with expected key. Returns client.ErrWrongPublicKey if not. func VerifyResponseKeyV2(expectedKey []byte, resp interface { - GetVerificationHeader() *session.ResponseVerificationHeader + GetVerifyHeader() *sessionGRPC.ResponseVerificationHeader }) error { - if !bytes.Equal(resp.GetVerificationHeader().GetBodySignature().GetKey(), expectedKey) { + if !bytes.Equal(resp.GetVerifyHeader().GetBodySignature().GetKey(), expectedKey) { return client.ErrWrongPublicKey } diff --git a/pkg/services/object/metrics.go b/pkg/services/object/metrics.go index f972f43ae..077bde5a7 100644 --- a/pkg/services/object/metrics.go +++ b/pkg/services/object/metrics.go @@ -4,7 +4,7 @@ import ( "context" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -41,7 +41,7 @@ func NewMetricCollector(next ServiceServer, register MetricRegister, enabled boo } } -func (m MetricCollector) Get(req *object.GetRequest, stream GetObjectStream) (err error) { +func (m MetricCollector) Get(req *objectGRPC.GetRequest, stream GetObjectStream) (err error) { if m.enabled { t := time.Now() defer func() { @@ -76,7 +76,7 @@ func (m MetricCollector) Put() (PutObjectStream, error) { return m.next.Put() } -func (m MetricCollector) PutSingle(ctx context.Context, request *object.PutSingleRequest) (*object.PutSingleResponse, error) { +func (m MetricCollector) PutSingle(ctx context.Context, request *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { if m.enabled { t := time.Now() @@ -92,7 +92,7 @@ func (m MetricCollector) PutSingle(ctx context.Context, request *object.PutSingl return m.next.PutSingle(ctx, request) } -func (m MetricCollector) Head(ctx context.Context, request *object.HeadRequest) (*object.HeadResponse, error) { +func (m MetricCollector) Head(ctx context.Context, request *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { if m.enabled { t := time.Now() @@ -105,7 +105,7 @@ func (m MetricCollector) Head(ctx context.Context, request *object.HeadRequest) return m.next.Head(ctx, request) } -func (m MetricCollector) Search(req *object.SearchRequest, stream SearchStream) error { +func (m MetricCollector) Search(req *objectGRPC.SearchRequest, stream SearchStream) error { if m.enabled { t := time.Now() @@ -118,7 +118,7 @@ func (m MetricCollector) Search(req *object.SearchRequest, stream SearchStream) return m.next.Search(req, stream) } -func (m MetricCollector) Delete(ctx context.Context, request *object.DeleteRequest) (*object.DeleteResponse, error) { +func (m MetricCollector) Delete(ctx context.Context, request *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) { if m.enabled { t := time.Now() @@ -130,7 +130,7 @@ func (m MetricCollector) Delete(ctx context.Context, request *object.DeleteReque return m.next.Delete(ctx, request) } -func (m MetricCollector) GetRange(req *object.GetRangeRequest, stream GetObjectRangeStream) error { +func (m MetricCollector) GetRange(req *objectGRPC.GetRangeRequest, stream GetObjectRangeStream) error { if m.enabled { t := time.Now() @@ -143,7 +143,7 @@ func (m MetricCollector) GetRange(req *object.GetRangeRequest, stream GetObjectR return m.next.GetRange(req, stream) } -func (m MetricCollector) GetRangeHash(ctx context.Context, request *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error) { +func (m MetricCollector) GetRangeHash(ctx context.Context, request *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) { if m.enabled { t := time.Now() @@ -164,8 +164,8 @@ func (m *MetricCollector) Disable() { m.enabled = false } -func (s getStreamMetric) Send(resp *object.GetResponse) error { - chunk, ok := resp.GetBody().GetObjectPart().(*object.GetObjectPartChunk) +func (s getStreamMetric) Send(resp *objectGRPC.GetResponse) error { + chunk, ok := resp.GetBody().GetObjectPart().(*objectGRPC.GetResponse_Body_Chunk) if ok { s.metrics.AddPayloadSize("Get", len(chunk.GetChunk())) } @@ -173,8 +173,8 @@ func (s getStreamMetric) Send(resp *object.GetResponse) error { return s.stream.Send(resp) } -func (s putStreamMetric) Send(ctx context.Context, req *object.PutRequest) error { - chunk, ok := req.GetBody().GetObjectPart().(*object.PutObjectPartChunk) +func (s putStreamMetric) Send(ctx context.Context, req *objectGRPC.PutRequest) error { + chunk, ok := req.GetBody().GetObjectPart().(*objectGRPC.PutRequest_Body_Chunk) if ok { s.metrics.AddPayloadSize("Put", len(chunk.GetChunk())) } @@ -182,7 +182,7 @@ func (s putStreamMetric) Send(ctx context.Context, req *object.PutRequest) error return s.stream.Send(ctx, req) } -func (s putStreamMetric) CloseAndRecv(ctx context.Context) (*object.PutResponse, error) { +func (s putStreamMetric) CloseAndRecv(ctx context.Context) (*objectGRPC.PutResponse, error) { res, err := s.stream.CloseAndRecv(ctx) s.metrics.AddRequestDuration("Put", time.Since(s.start), err == nil) diff --git a/pkg/services/object/put/single.go b/pkg/services/object/put/single.go index 200830e15..2d05c055f 100644 --- a/pkg/services/object/put/single.go +++ b/pkg/services/object/put/single.go @@ -10,10 +10,10 @@ import ( "sync" "sync/atomic" - objectAPI "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rawclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessiongrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" @@ -32,18 +32,18 @@ import ( ) type putSingleRequestSigner struct { - req *objectAPI.PutSingleRequest + req *objectgrpc.PutSingleRequest keyStorage *svcutil.KeyStorage signer *sync.Once } -func (s *putSingleRequestSigner) GetRequestWithSignedHeader() (*objectAPI.PutSingleRequest, error) { +func (s *putSingleRequestSigner) GetRequestWithSignedHeader() (*objectgrpc.PutSingleRequest, error) { var resErr error s.signer.Do(func() { - metaHdr := new(sessionV2.RequestMetaHeader) + metaHdr := new(sessiongrpc.RequestMetaHeader) meta := s.req.GetMetaHeader() - metaHdr.SetTTL(meta.GetTTL() - 1) + metaHdr.SetTtl(meta.GetTtl() - 1) metaHdr.SetOrigin(meta) s.req.SetMetaHeader(metaHdr) @@ -57,7 +57,7 @@ func (s *putSingleRequestSigner) GetRequestWithSignedHeader() (*objectAPI.PutSin return s.req, resErr } -func (s *Service) PutSingle(ctx context.Context, req *objectAPI.PutSingleRequest) (*objectAPI.PutSingleResponse, error) { +func (s *Service) PutSingle(ctx context.Context, req *objectgrpc.PutSingleRequest) (*objectgrpc.PutSingleResponse, error) { ctx, span := tracing.StartSpanFromContext(ctx, "putsvc.PutSingle") defer span.End() @@ -71,8 +71,8 @@ func (s *Service) PutSingle(ctx context.Context, req *objectAPI.PutSingleRequest return nil, err } - resp := &objectAPI.PutSingleResponse{} - resp.SetBody(&objectAPI.PutSingleResponseBody{}) + resp := &objectgrpc.PutSingleResponse{} + resp.SetBody(&objectgrpc.PutSingleResponse_Body{}) return resp, nil } @@ -142,8 +142,8 @@ func (s *Service) validatePutSingleObject(ctx context.Context, obj *objectSDK.Ob return nil } -func (s *Service) saveToNodes(ctx context.Context, obj *objectSDK.Object, req *objectAPI.PutSingleRequest) error { - localOnly := req.GetMetaHeader().GetTTL() <= 1 +func (s *Service) saveToNodes(ctx context.Context, obj *objectSDK.Object, req *objectgrpc.PutSingleRequest) error { + localOnly := req.GetMetaHeader().GetTtl() <= 1 placementOptions, err := s.getPutSinglePlacementOptions(obj, req.GetBody().GetCopiesNumber(), localOnly) if err != nil { return err @@ -307,7 +307,7 @@ func (s *Service) redirectPutSingleRequest(ctx context.Context, ctx, span := tracing.StartSpanFromContext(ctx, "putService.redirectPutSingleRequest") defer span.End() - var req *objectAPI.PutSingleRequest + var req *objectgrpc.PutSingleRequest var firstErr error req, firstErr = signer.GetRequestWithSignedHeader() if firstErr != nil { @@ -341,7 +341,7 @@ func (s *Service) redirectPutSingleRequest(ctx context.Context, } }() - var resp *objectAPI.PutSingleResponse + var resp *objectgrpc.PutSingleResponse err = c.RawForAddress(ctx, addr, func(cli *rawclient.Client) error { var e error diff --git a/pkg/services/object/put/v2/service.go b/pkg/services/object/put/v2/service.go index 78655edc7..a47230c53 100644 --- a/pkg/services/object/put/v2/service.go +++ b/pkg/services/object/put/v2/service.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - objectAPI "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" @@ -49,7 +49,7 @@ func (s *Service) Put() (object.PutObjectStream, error) { }, nil } -func (s *Service) PutSingle(ctx context.Context, req *objectAPI.PutSingleRequest) (*objectAPI.PutSingleResponse, error) { +func (s *Service) PutSingle(ctx context.Context, req *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { return s.svc.PutSingle(ctx, req) } diff --git a/pkg/services/object/put/v2/streamer.go b/pkg/services/object/put/v2/streamer.go index 9c6de4ca8..50d0fb5c3 100644 --- a/pkg/services/object/put/v2/streamer.go +++ b/pkg/services/object/put/v2/streamer.go @@ -4,10 +4,11 @@ import ( "context" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rawclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -24,8 +25,8 @@ type streamer struct { stream *putsvc.Streamer keyStorage *util.KeyStorage saveChunks bool - init *object.PutRequest - chunks []*object.PutRequest + init *objectGRPC.PutRequest + chunks []*objectGRPC.PutRequest *sizes // only for relay streams } @@ -36,12 +37,12 @@ type sizes struct { writtenPayload uint64 // sum size of already cached chunks } -func (s *streamer) Send(ctx context.Context, req *object.PutRequest) (err error) { +func (s *streamer) Send(ctx context.Context, req *objectGRPC.PutRequest) (err error) { ctx, span := tracing.StartSpanFromContext(ctx, "putv2.streamer.Send") defer span.End() switch v := req.GetBody().GetObjectPart().(type) { - case *object.PutObjectPartInit: + case *object.PutRequest_Body_Init_: var initPrm *putsvc.PutInitPrm initPrm, err = s.toInitPrm(v, req) @@ -53,12 +54,12 @@ func (s *streamer) Send(ctx context.Context, req *object.PutRequest) (err error) err = fmt.Errorf("(%T) could not init object put stream: %w", s, err) } - s.saveChunks = v.GetSignature() != nil + s.saveChunks = v.Init.GetSignature() != nil if s.saveChunks { maxSz := s.stream.MaxObjectSize() s.sizes = &sizes{ - payloadSz: uint64(v.GetHeader().GetPayloadLength()), + payloadSz: uint64(v.Init.GetHeader().GetPayloadLength()), } // check payload size limit overflow @@ -68,7 +69,7 @@ func (s *streamer) Send(ctx context.Context, req *object.PutRequest) (err error) s.init = req } - case *object.PutObjectPartChunk: + case *objectGRPC.PutRequest_Body_Chunk: if s.saveChunks { s.writtenPayload += uint64(len(v.GetChunk())) @@ -96,7 +97,7 @@ func (s *streamer) Send(ctx context.Context, req *object.PutRequest) (err error) metaHdr := new(sessionV2.RequestMetaHeader) meta := req.GetMetaHeader() - metaHdr.SetTTL(meta.GetTTL() - 1) + metaHdr.SetTtl(meta.GetTtl() - 1) metaHdr.SetOrigin(meta) req.SetMetaHeader(metaHdr) @@ -110,7 +111,7 @@ func (s *streamer) Send(ctx context.Context, req *object.PutRequest) (err error) return signature.SignServiceMessage(key, req) } -func (s *streamer) CloseAndRecv(ctx context.Context) (*object.PutResponse, error) { +func (s *streamer) CloseAndRecv(ctx context.Context) (*objectGRPC.PutResponse, error) { ctx, span := tracing.StartSpanFromContext(ctx, "putv2.streamer.CloseAndRecv") defer span.End() @@ -134,7 +135,7 @@ func (s *streamer) relayRequest(ctx context.Context, info client.NodeInfo, c cli defer span.End() // open stream - resp := new(object.PutResponse) + resp := new(objectGRPC.PutResponse) key := info.PublicKey() diff --git a/pkg/services/object/put/v2/util.go b/pkg/services/object/put/v2/util.go index a157a9542..63baac30c 100644 --- a/pkg/services/object/put/v2/util.go +++ b/pkg/services/object/put/v2/util.go @@ -1,18 +1,18 @@ package putsvc import ( - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" ) -func (s *streamer) toInitPrm(part *objectV2.PutObjectPartInit, req *objectV2.PutRequest) (*putsvc.PutInitPrm, error) { +func (s *streamer) toInitPrm(part *objectV2.PutRequest_Body_Init_, req *objectV2.PutRequest) (*putsvc.PutInitPrm, error) { oV2 := new(objectV2.Object) - oV2.SetObjectID(part.GetObjectID()) - oV2.SetSignature(part.GetSignature()) - oV2.SetHeader(part.GetHeader()) + oV2.SetObjectId(part.Init.GetObjectId()) + oV2.SetSignature(part.Init.GetSignature()) + oV2.SetHeader(part.Init.GetHeader()) commonPrm, err := util.CommonPrmFromV2(req) if err != nil { @@ -28,7 +28,7 @@ func (s *streamer) toInitPrm(part *objectV2.PutObjectPartInit, req *objectV2.Put WithCopyNumbers(part.GetCopiesNumber()), nil } -func toChunkPrm(req *objectV2.PutObjectPartChunk) *putsvc.PutChunkPrm { +func toChunkPrm(req *objectV2.PutRequest_Body_Chunk) *putsvc.PutChunkPrm { return new(putsvc.PutChunkPrm). WithChunk(req.GetChunk()) } @@ -37,8 +37,8 @@ func fromPutResponse(r *putsvc.PutResponse) *objectV2.PutResponse { var idV2 refsV2.ObjectID r.ObjectID().WriteToV2(&idV2) - body := new(objectV2.PutResponseBody) - body.SetObjectID(&idV2) + body := new(objectV2.PutResponse_Body) + body.SetObjectId(&idV2) resp := new(objectV2.PutResponse) resp.SetBody(body) diff --git a/pkg/services/object/response.go b/pkg/services/object/response.go index a10f26a34..4577a4f05 100644 --- a/pkg/services/object/response.go +++ b/pkg/services/object/response.go @@ -4,7 +4,8 @@ import ( "context" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response" ) @@ -51,7 +52,7 @@ func (s *getStreamResponser) Send(resp *object.GetResponse) error { return s.GetObjectStream.Send(resp) } -func (s *ResponseService) Get(req *object.GetRequest, stream GetObjectStream) error { +func (s *ResponseService) Get(req *objectGRPC.GetRequest, stream GetObjectStream) error { return s.svc.Get(req, &getStreamResponser{ GetObjectStream: stream, respSvc: s.respSvc, @@ -65,7 +66,7 @@ func (s *putStreamResponser) Send(ctx context.Context, req *object.PutRequest) e return nil } -func (s *putStreamResponser) CloseAndRecv(ctx context.Context) (*object.PutResponse, error) { +func (s *putStreamResponser) CloseAndRecv(ctx context.Context) (*objectGRPC.PutResponse, error) { r, err := s.stream.CloseAndRecv(ctx) if err != nil { return nil, fmt.Errorf("could not close stream and receive response: %w", err) @@ -112,7 +113,7 @@ func (s *searchStreamResponser) Send(resp *object.SearchResponse) error { return s.SearchStream.Send(resp) } -func (s *ResponseService) Search(req *object.SearchRequest, stream SearchStream) error { +func (s *ResponseService) Search(req *objectGRPC.SearchRequest, stream SearchStream) error { return s.svc.Search(req, &searchStreamResponser{ SearchStream: stream, respSvc: s.respSvc, @@ -134,7 +135,7 @@ func (s *getRangeStreamResponser) Send(resp *object.GetRangeResponse) error { return s.GetObjectRangeStream.Send(resp) } -func (s *ResponseService) GetRange(req *object.GetRangeRequest, stream GetObjectRangeStream) error { +func (s *ResponseService) GetRange(req *objectGRPC.GetRangeRequest, stream GetObjectRangeStream) error { return s.svc.GetRange(req, &getRangeStreamResponser{ GetObjectRangeStream: stream, respSvc: s.respSvc, diff --git a/pkg/services/object/search/search_test.go b/pkg/services/object/search/search_test.go index 75059103f..c49107f57 100644 --- a/pkg/services/object/search/search_test.go +++ b/pkg/services/object/search/search_test.go @@ -9,7 +9,7 @@ import ( "strconv" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" clientcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" netmapcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -213,7 +213,7 @@ func testNodeMatrix(t testing.TB, dim []int) ([][]netmap.NodeInfo, [][]string) { strconv.Itoa(60000+j), ) - var ni netmap.NodeInfo + ni := netmap.NewNodeInfo() ni.SetNetworkEndpoints(a) var na network.AddressGroup @@ -240,13 +240,14 @@ func TestGetRemoteSmall(t *testing.T) { rs := make([]netmap.ReplicaDescriptor, len(placementDim)) for i := range placementDim { + rs[i] = netmap.NewReplicaDescriptor() rs[i].SetNumberOfObjects(uint32(placementDim[i])) } var pp netmap.PlacementPolicy pp.AddReplicas(rs...) - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(pp) var id cid.ID @@ -329,13 +330,14 @@ func TestGetFromPastEpoch(t *testing.T) { rs := make([]netmap.ReplicaDescriptor, len(placementDim)) for i := range placementDim { + rs[i] = netmap.NewReplicaDescriptor() rs[i].SetNumberOfObjects(uint32(placementDim[i])) } var pp netmap.PlacementPolicy pp.AddReplicas(rs...) - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(pp) var idCnr cid.ID @@ -438,13 +440,14 @@ func TestGetWithSessionToken(t *testing.T) { rs := make([]netmap.ReplicaDescriptor, len(placementDim)) for i := range placementDim { + rs[i] = netmap.NewReplicaDescriptor() rs[i].SetNumberOfObjects(uint32(placementDim[i])) } var pp netmap.PlacementPolicy pp.AddReplicas(rs...) - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(pp) var id cid.ID @@ -528,9 +531,9 @@ type metaStub struct { ContainerID cid.ID } -func (m *metaStub) GetMetaHeader() *session.RequestMetaHeader { - var result session.RequestMetaHeader - result.SetTTL(m.TTL) +func (m *metaStub) GetMetaHeader() *sessionGRPC.RequestMetaHeader { + var result sessionGRPC.RequestMetaHeader + result.SetTtl(m.TTL) tokenObj := new(sessionsdk.Object) tokenObj.ForVerb(sessionsdk.VerbObjectSearch) @@ -548,7 +551,7 @@ func (m *metaStub) GetMetaHeader() *session.RequestMetaHeader { require.NoError(m.T, tokenObj.Sign(priv.PrivateKey)) - var token session.Token + var token sessionGRPC.SessionToken tokenObj.WriteToV2(&token) result.SetSessionToken(&token) diff --git a/pkg/services/object/search/v2/request_forwarder.go b/pkg/services/object/search/v2/request_forwarder.go index 5a2e9b936..dbb46ea51 100644 --- a/pkg/services/object/search/v2/request_forwarder.go +++ b/pkg/services/object/search/v2/request_forwarder.go @@ -8,10 +8,10 @@ import ( "io" "sync" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" rpcclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" @@ -31,8 +31,8 @@ func (f *requestForwarder) forwardRequest(ctx context.Context, addr network.Addr // once compose and resign forwarding request f.OnceResign.Do(func() { // compose meta header of the local server - metaHdr := new(session.RequestMetaHeader) - metaHdr.SetTTL(f.Request.GetMetaHeader().GetTTL() - 1) + metaHdr := new(sessionGRPC.RequestMetaHeader) + metaHdr.SetTtl(f.Request.GetMetaHeader().GetTtl() - 1) // TODO: #1165 think how to set the other fields metaHdr.SetOrigin(f.Request.GetMetaHeader()) @@ -82,7 +82,7 @@ func (f *requestForwarder) forwardRequest(ctx context.Context, addr network.Addr return nil, fmt.Errorf("could not verify %T: %w", resp, err) } - chunk := resp.GetBody().GetIDList() + chunk := resp.GetBody().GetIdList() var id oid.ID for i := range chunk { diff --git a/pkg/services/object/search/v2/service.go b/pkg/services/object/search/v2/service.go index 17e1bc7e0..76e176579 100644 --- a/pkg/services/object/search/v2/service.go +++ b/pkg/services/object/search/v2/service.go @@ -1,7 +1,7 @@ package searchsvc import ( - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" searchsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/search" objutil "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" diff --git a/pkg/services/object/search/v2/streamer.go b/pkg/services/object/search/v2/streamer.go index 15e2d53d5..b4e73a02d 100644 --- a/pkg/services/object/search/v2/streamer.go +++ b/pkg/services/object/search/v2/streamer.go @@ -1,8 +1,8 @@ package searchsvc import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) @@ -12,18 +12,19 @@ type streamWriter struct { } func (s *streamWriter) WriteIDs(ids []oid.ID) error { - r := new(object.SearchResponse) + r := new(objectGRPC.SearchResponse) - body := new(object.SearchResponseBody) + body := new(objectGRPC.SearchResponse_Body) r.SetBody(body) - idsV2 := make([]refs.ObjectID, len(ids)) + idsV2 := make([]*refsGRPC.ObjectID, len(ids)) for i := range ids { - ids[i].WriteToV2(&idsV2[i]) + idsV2[i] = new(refsGRPC.ObjectID) + ids[i].WriteToV2(idsV2[i]) } - body.SetIDList(idsV2) + body.SetIdList(idsV2) return s.stream.Send(r) } diff --git a/pkg/services/object/search/v2/util.go b/pkg/services/object/search/v2/util.go index e971fa8e5..c292d5722 100644 --- a/pkg/services/object/search/v2/util.go +++ b/pkg/services/object/search/v2/util.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object" @@ -19,14 +19,14 @@ import ( func (s *Service) toPrm(req *objectV2.SearchRequest, stream objectSvc.SearchStream) (*searchsvc.Prm, error) { body := req.GetBody() - cnrV2 := body.GetContainerID() + cnrV2 := body.GetContainerId() if cnrV2 == nil { return nil, errors.New("missing container ID") } var id cid.ID - err := id.ReadFromV2(*cnrV2) + err := id.ReadFromV2(cnrV2) if err != nil { return nil, fmt.Errorf("invalid container ID: %w", err) } diff --git a/pkg/services/object/server.go b/pkg/services/object/server.go index 73b88f233..eb3fdba8c 100644 --- a/pkg/services/object/server.go +++ b/pkg/services/object/server.go @@ -3,43 +3,43 @@ package object import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) // GetObjectStream is an interface of FrostFS API v2 compatible object streamer. type GetObjectStream interface { util.ServerStream - Send(*object.GetResponse) error + Send(*objectGRPC.GetResponse) error } // GetObjectRangeStream is an interface of FrostFS API v2 compatible payload range streamer. type GetObjectRangeStream interface { util.ServerStream - Send(*object.GetRangeResponse) error + Send(*objectGRPC.GetRangeResponse) error } // SearchStream is an interface of FrostFS API v2 compatible search streamer. type SearchStream interface { util.ServerStream - Send(*object.SearchResponse) error + Send(*objectGRPC.SearchResponse) error } // PutObjectStream is an interface of FrostFS API v2 compatible client's object streamer. type PutObjectStream interface { - Send(context.Context, *object.PutRequest) error - CloseAndRecv(context.Context) (*object.PutResponse, error) + Send(context.Context, *objectGRPC.PutRequest) error + CloseAndRecv(context.Context) (*objectGRPC.PutResponse, error) } // ServiceServer is an interface of utility // serving v2 Object service. type ServiceServer interface { - Get(*object.GetRequest, GetObjectStream) error + Get(*objectGRPC.GetRequest, GetObjectStream) error Put() (PutObjectStream, error) - Head(context.Context, *object.HeadRequest) (*object.HeadResponse, error) - Search(*object.SearchRequest, SearchStream) error - Delete(context.Context, *object.DeleteRequest) (*object.DeleteResponse, error) - GetRange(*object.GetRangeRequest, GetObjectRangeStream) error - GetRangeHash(context.Context, *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error) - PutSingle(context.Context, *object.PutSingleRequest) (*object.PutSingleResponse, error) + Head(context.Context, *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) + Search(*objectGRPC.SearchRequest, SearchStream) error + Delete(context.Context, *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) + GetRange(*objectGRPC.GetRangeRequest, GetObjectRangeStream) error + GetRangeHash(context.Context, *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) + PutSingle(context.Context, *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) } diff --git a/pkg/services/object/sign.go b/pkg/services/object/sign.go index 5b3578e29..5673321e9 100644 --- a/pkg/services/object/sign.go +++ b/pkg/services/object/sign.go @@ -5,7 +5,7 @@ import ( "crypto/ecdsa" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -49,17 +49,17 @@ func NewSignService(key *ecdsa.PrivateKey, svc ServiceServer) *SignService { } } -func (s *getStreamSigner) Send(resp *object.GetResponse) error { +func (s *getStreamSigner) Send(resp *objectGRPC.GetResponse) error { return s.respWriter(resp) } -func (s *SignService) Get(req *object.GetRequest, stream GetObjectStream) error { +func (s *SignService) Get(req *objectGRPC.GetRequest, stream GetObjectStream) error { return s.sigSvc.HandleServerStreamRequest(req, func(resp util.ResponseMessage) error { - return stream.Send(resp.(*object.GetResponse)) + return stream.Send(resp.(*objectGRPC.GetResponse)) }, func() util.ResponseMessage { - return new(object.GetResponse) + return new(objectGRPC.GetResponse) }, func(respWriter util.ResponseMessageWriter) error { return s.svc.Get(req, &getStreamSigner{ @@ -70,17 +70,17 @@ func (s *SignService) Get(req *object.GetRequest, stream GetObjectStream) error ) } -func (s *putStreamSigner) Send(ctx context.Context, req *object.PutRequest) error { +func (s *putStreamSigner) Send(ctx context.Context, req *objectGRPC.PutRequest) error { return s.stream.Send(ctx, req) } -func (s *putStreamSigner) CloseAndRecv(ctx context.Context) (*object.PutResponse, error) { +func (s *putStreamSigner) CloseAndRecv(ctx context.Context) (*objectGRPC.PutResponse, error) { r, err := s.stream.CloseAndRecv(ctx) if err != nil { return nil, fmt.Errorf("could not receive response: %w", err) } - return r.(*object.PutResponse), nil + return r.(*objectGRPC.PutResponse), nil } func (s *SignService) Put() (PutObjectStream, error) { @@ -92,62 +92,62 @@ func (s *SignService) Put() (PutObjectStream, error) { return &putStreamSigner{ stream: s.sigSvc.CreateRequestStreamer( func(ctx context.Context, req any) error { - return stream.Send(ctx, req.(*object.PutRequest)) + return stream.Send(ctx, req.(*objectGRPC.PutRequest)) }, func(ctx context.Context) (util.ResponseMessage, error) { return stream.CloseAndRecv(ctx) }, func() util.ResponseMessage { - return new(object.PutResponse) + return new(objectGRPC.PutResponse) }, ), }, nil } -func (s *SignService) Head(ctx context.Context, req *object.HeadRequest) (*object.HeadResponse, error) { +func (s *SignService) Head(ctx context.Context, req *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Head(ctx, req.(*object.HeadRequest)) + return s.svc.Head(ctx, req.(*objectGRPC.HeadRequest)) }, func() util.ResponseMessage { - return new(object.HeadResponse) + return new(objectGRPC.HeadResponse) }, ) if err != nil { return nil, err } - return resp.(*object.HeadResponse), nil + return resp.(*objectGRPC.HeadResponse), nil } -func (s *SignService) PutSingle(ctx context.Context, req *object.PutSingleRequest) (*object.PutSingleResponse, error) { +func (s *SignService) PutSingle(ctx context.Context, req *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.PutSingle(ctx, req.(*object.PutSingleRequest)) + return s.svc.PutSingle(ctx, req.(*objectGRPC.PutSingleRequest)) }, func() util.ResponseMessage { - return new(object.PutSingleResponse) + return new(objectGRPC.PutSingleResponse) }, ) if err != nil { return nil, err } - return resp.(*object.PutSingleResponse), nil + return resp.(*objectGRPC.PutSingleResponse), nil } -func (s *searchStreamSigner) Send(resp *object.SearchResponse) error { +func (s *searchStreamSigner) Send(resp *objectGRPC.SearchResponse) error { s.nonEmptyResp = true return s.respWriter(resp) } -func (s *SignService) Search(req *object.SearchRequest, stream SearchStream) error { +func (s *SignService) Search(req *objectGRPC.SearchRequest, stream SearchStream) error { return s.sigSvc.HandleServerStreamRequest(req, func(resp util.ResponseMessage) error { - return stream.Send(resp.(*object.SearchResponse)) + return stream.Send(resp.(*objectGRPC.SearchResponse)) }, func() util.ResponseMessage { - return new(object.SearchResponse) + return new(objectGRPC.SearchResponse) }, func(respWriter util.ResponseMessageWriter) error { stream := &searchStreamSigner{ @@ -163,7 +163,7 @@ func (s *SignService) Search(req *object.SearchRequest, stream SearchStream) err // This approach is supported by clients who do not know how to work with statuses (one could make // a switch according to the protocol version from the request, but the costs of sending an empty // answer can be neglected due to the gradual refusal to use the "old" clients). - return stream.Send(new(object.SearchResponse)) + return stream.Send(new(objectGRPC.SearchResponse)) } return err @@ -171,33 +171,33 @@ func (s *SignService) Search(req *object.SearchRequest, stream SearchStream) err ) } -func (s *SignService) Delete(ctx context.Context, req *object.DeleteRequest) (*object.DeleteResponse, error) { +func (s *SignService) Delete(ctx context.Context, req *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Delete(ctx, req.(*object.DeleteRequest)) + return s.svc.Delete(ctx, req.(*objectGRPC.DeleteRequest)) }, func() util.ResponseMessage { - return new(object.DeleteResponse) + return new(objectGRPC.DeleteResponse) }, ) if err != nil { return nil, err } - return resp.(*object.DeleteResponse), nil + return resp.(*objectGRPC.DeleteResponse), nil } -func (s *getRangeStreamSigner) Send(resp *object.GetRangeResponse) error { +func (s *getRangeStreamSigner) Send(resp *objectGRPC.GetRangeResponse) error { return s.respWriter(resp) } -func (s *SignService) GetRange(req *object.GetRangeRequest, stream GetObjectRangeStream) error { +func (s *SignService) GetRange(req *objectGRPC.GetRangeRequest, stream GetObjectRangeStream) error { return s.sigSvc.HandleServerStreamRequest(req, func(resp util.ResponseMessage) error { - return stream.Send(resp.(*object.GetRangeResponse)) + return stream.Send(resp.(*objectGRPC.GetRangeResponse)) }, func() util.ResponseMessage { - return new(object.GetRangeResponse) + return new(objectGRPC.GetRangeResponse) }, func(respWriter util.ResponseMessageWriter) error { return s.svc.GetRange(req, &getRangeStreamSigner{ @@ -208,18 +208,18 @@ func (s *SignService) GetRange(req *object.GetRangeRequest, stream GetObjectRang ) } -func (s *SignService) GetRangeHash(ctx context.Context, req *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error) { +func (s *SignService) GetRangeHash(ctx context.Context, req *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.GetRangeHash(ctx, req.(*object.GetRangeHashRequest)) + return s.svc.GetRangeHash(ctx, req.(*objectGRPC.GetRangeHashRequest)) }, func() util.ResponseMessage { - return new(object.GetRangeHashResponse) + return new(objectGRPC.GetRangeHashResponse) }, ) if err != nil { return nil, err } - return resp.(*object.GetRangeHashResponse), nil + return resp.(*objectGRPC.GetRangeHashResponse), nil } diff --git a/pkg/services/object/transport_splitter.go b/pkg/services/object/transport_splitter.go index 2d9810cd3..7a6b21ba0 100644 --- a/pkg/services/object/transport_splitter.go +++ b/pkg/services/object/transport_splitter.go @@ -4,7 +4,7 @@ import ( "bytes" "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -41,27 +41,27 @@ type ( } ) -func (s *getStreamMsgSizeCtrl) Send(resp *object.GetResponse) error { +func (s *getStreamMsgSizeCtrl) Send(resp *objectGRPC.GetResponse) error { body := resp.GetBody() part := body.GetObjectPart() - chunkPart, ok := part.(*object.GetObjectPartChunk) + chunkPart, ok := part.(*objectGRPC.GetResponse_Body_Chunk) if !ok { return s.stream.Send(resp) } - var newResp *object.GetResponse + var newResp *objectGRPC.GetResponse for buf := bytes.NewBuffer(chunkPart.GetChunk()); buf.Len() > 0; { if newResp == nil { - newResp = new(object.GetResponse) + newResp = new(objectGRPC.GetResponse) newResp.SetBody(body) } chunkPart.SetChunk(buf.Next(s.chunkSize)) newResp.SetMetaHeader(resp.GetMetaHeader()) - newResp.SetVerificationHeader(resp.GetVerificationHeader()) + newResp.SetVerifyHeader(resp.GetVerifyHeader()) if err := s.stream.Send(newResp); err != nil { return err @@ -79,7 +79,7 @@ func NewTransportSplitter(size, amount uint64, next ServiceServer) *TransportSpl } } -func (c *TransportSplitter) Get(req *object.GetRequest, stream GetObjectStream) error { +func (c *TransportSplitter) Get(req *objectGRPC.GetRequest, stream GetObjectStream) error { return c.next.Get(req, &getStreamMsgSizeCtrl{ ServerStream: stream, stream: stream, @@ -91,11 +91,11 @@ func (c TransportSplitter) Put() (PutObjectStream, error) { return c.next.Put() } -func (c TransportSplitter) Head(ctx context.Context, request *object.HeadRequest) (*object.HeadResponse, error) { +func (c TransportSplitter) Head(ctx context.Context, request *objectGRPC.HeadRequest) (*objectGRPC.HeadResponse, error) { return c.next.Head(ctx, request) } -func (c TransportSplitter) Search(req *object.SearchRequest, stream SearchStream) error { +func (c TransportSplitter) Search(req *objectGRPC.SearchRequest, stream SearchStream) error { return c.next.Search(req, &searchStreamMsgSizeCtrl{ ServerStream: stream, stream: stream, @@ -103,34 +103,34 @@ func (c TransportSplitter) Search(req *object.SearchRequest, stream SearchStream }) } -func (c TransportSplitter) Delete(ctx context.Context, request *object.DeleteRequest) (*object.DeleteResponse, error) { +func (c TransportSplitter) Delete(ctx context.Context, request *objectGRPC.DeleteRequest) (*objectGRPC.DeleteResponse, error) { return c.next.Delete(ctx, request) } -func (c TransportSplitter) PutSingle(ctx context.Context, req *object.PutSingleRequest) (*object.PutSingleResponse, error) { +func (c TransportSplitter) PutSingle(ctx context.Context, req *objectGRPC.PutSingleRequest) (*objectGRPC.PutSingleResponse, error) { return c.next.PutSingle(ctx, req) } -func (s *rangeStreamMsgSizeCtrl) Send(resp *object.GetRangeResponse) error { +func (s *rangeStreamMsgSizeCtrl) Send(resp *objectGRPC.GetRangeResponse) error { body := resp.GetBody() - chunkPart, ok := body.GetRangePart().(*object.GetRangePartChunk) + chunkPart, ok := body.GetRangePart().(*objectGRPC.GetRangeResponse_Body_Chunk) if !ok { return s.stream.Send(resp) } - var newResp *object.GetRangeResponse + var newResp *objectGRPC.GetRangeResponse for buf := bytes.NewBuffer(chunkPart.GetChunk()); buf.Len() > 0; { if newResp == nil { - newResp = new(object.GetRangeResponse) + newResp = new(objectGRPC.GetRangeResponse) newResp.SetBody(body) } chunkPart.SetChunk(buf.Next(s.chunkSize)) - body.SetRangePart(chunkPart) + body.RangePart = chunkPart newResp.SetMetaHeader(resp.GetMetaHeader()) - newResp.SetVerificationHeader(resp.GetVerificationHeader()) + newResp.SetVerifyHeader(resp.GetVerifyHeader()) if err := s.stream.Send(newResp); err != nil { return err @@ -140,7 +140,7 @@ func (s *rangeStreamMsgSizeCtrl) Send(resp *object.GetRangeResponse) error { return nil } -func (c TransportSplitter) GetRange(req *object.GetRangeRequest, stream GetObjectRangeStream) error { +func (c TransportSplitter) GetRange(req *objectGRPC.GetRangeRequest, stream GetObjectRangeStream) error { return c.next.GetRange(req, &rangeStreamMsgSizeCtrl{ ServerStream: stream, stream: stream, @@ -148,19 +148,19 @@ func (c TransportSplitter) GetRange(req *object.GetRangeRequest, stream GetObjec }) } -func (c TransportSplitter) GetRangeHash(ctx context.Context, request *object.GetRangeHashRequest) (*object.GetRangeHashResponse, error) { +func (c TransportSplitter) GetRangeHash(ctx context.Context, request *objectGRPC.GetRangeHashRequest) (*objectGRPC.GetRangeHashResponse, error) { return c.next.GetRangeHash(ctx, request) } -func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error { +func (s *searchStreamMsgSizeCtrl) Send(resp *objectGRPC.SearchResponse) error { body := resp.GetBody() - ids := body.GetIDList() + ids := body.GetIdList() - var newResp *object.SearchResponse + var newResp *objectGRPC.SearchResponse for ln := uint64(len(ids)); ; { if newResp == nil { - newResp = new(object.SearchResponse) + newResp = new(objectGRPC.SearchResponse) newResp.SetBody(body) } @@ -169,9 +169,9 @@ func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error { cut = ln } - body.SetIDList(ids[:cut]) + body.SetIdList(ids[:cut]) newResp.SetMetaHeader(resp.GetMetaHeader()) - newResp.SetVerificationHeader(resp.GetVerificationHeader()) + newResp.SetVerifyHeader(resp.GetVerifyHeader()) if err := s.stream.Send(newResp); err != nil { return err diff --git a/pkg/services/object/util/key_test.go b/pkg/services/object/util/key_test.go index 76e320e0c..1aaf5527c 100644 --- a/pkg/services/object/util/key_test.go +++ b/pkg/services/object/util/key_test.go @@ -5,8 +5,8 @@ import ( "crypto/elliptic" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" tokenStorage "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/session/storage/temporary" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -63,11 +63,11 @@ func TestNewKeyStorage(t *testing.T) { } func createToken(t *testing.T, store *tokenStorage.TokenStore, owner user.ID, exp uint64) session.Object { - var ownerV2 refs.OwnerID + var ownerV2 refsGRPC.OwnerID owner.WriteToV2(&ownerV2) - req := new(sessionV2.CreateRequestBody) - req.SetOwnerID(&ownerV2) + req := new(sessionV2.CreateRequest_Body) + req.SetOwnerId(&ownerV2) req.SetExpiration(exp) resp, err := store.Create(context.Background(), req) @@ -77,7 +77,7 @@ func createToken(t *testing.T, store *tokenStorage.TokenStore, owner user.ID, ex require.NoError(t, err) var id uuid.UUID - require.NoError(t, id.UnmarshalBinary(resp.GetID())) + require.NoError(t, id.UnmarshalBinary(resp.GetId())) var tok session.Object tok.SetAuthKey((*frostfsecdsa.PublicKey)(pub)) diff --git a/pkg/services/object/util/prm.go b/pkg/services/object/util/prm.go index c09c07cc1..14488223a 100644 --- a/pkg/services/object/util/prm.go +++ b/pkg/services/object/util/prm.go @@ -4,7 +4,8 @@ import ( "fmt" "strconv" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" sessionsdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) @@ -108,10 +109,10 @@ func (p *CommonPrm) ForgetTokens() { } func CommonPrmFromV2(req interface { - GetMetaHeader() *session.RequestMetaHeader + GetMetaHeader() *sessionGRPC.RequestMetaHeader }) (*CommonPrm, error) { meta := req.GetMetaHeader() - ttl := meta.GetTTL() + ttl := meta.GetTtl() // unwrap meta header to get original request meta information for meta.GetOrigin() != nil { @@ -124,7 +125,7 @@ func CommonPrmFromV2(req interface { if tokenSessionV2 := meta.GetSessionToken(); tokenSessionV2 != nil { tokenSession = new(sessionsdk.Object) - err = tokenSession.ReadFromV2(*tokenSessionV2) + err = tokenSession.ReadFromV2(tokenSessionV2) if err != nil { return nil, fmt.Errorf("invalid session token: %w", err) } @@ -141,7 +142,7 @@ func CommonPrmFromV2(req interface { if tok := meta.GetBearerToken(); tok != nil { prm.bearer = new(bearer.Token) - err = prm.bearer.ReadFromV2(*tok) + err = prm.bearer.ReadFromV2(tok) if err != nil { return nil, fmt.Errorf("invalid bearer token: %w", err) } @@ -149,14 +150,14 @@ func CommonPrmFromV2(req interface { for i := range xHdrs { switch key := xHdrs[i].GetKey(); key { - case session.XHeaderNetmapEpoch: + case sessionapi.XHeaderNetmapEpoch: var err error prm.netmapEpoch, err = strconv.ParseUint(xHdrs[i].GetValue(), 10, 64) if err != nil { return nil, err } - case session.XHeaderNetmapLookupDepth: + case sessionapi.XHeaderNetmapLookupDepth: var err error prm.netmapLookupDepth, err = strconv.ParseUint(xHdrs[i].GetValue(), 10, 64) diff --git a/pkg/services/object_manager/placement/traverser_test.go b/pkg/services/object_manager/placement/traverser_test.go index 1b307da6f..f225551a7 100644 --- a/pkg/services/object_manager/placement/traverser_test.go +++ b/pkg/services/object_manager/placement/traverser_test.go @@ -22,6 +22,7 @@ func (b testBuilder) BuildPlacement(cid.ID, *oid.ID, netmap.PlacementPolicy) ([] } func testNode(v uint32) (n netmap.NodeInfo) { + n = netmap.NewNodeInfo() n.SetNetworkEndpoints("/ip4/0.0.0.0/tcp/" + strconv.Itoa(int(v))) return n @@ -55,7 +56,7 @@ func testPlacement(t *testing.T, ss, rs []int) ([][]netmap.NodeInfo, container.C nodes = append(nodes, ns) - var rd netmap.ReplicaDescriptor + rd := netmap.NewReplicaDescriptor() rd.SetNumberOfObjects(uint32(rs[i])) replicas = append(replicas, rd) @@ -64,7 +65,7 @@ func testPlacement(t *testing.T, ss, rs []int) ([][]netmap.NodeInfo, container.C var policy netmap.PlacementPolicy policy.AddReplicas(replicas...) - var cnr container.Container + cnr := container.NewContainer() cnr.SetPlacementPolicy(policy) return nodes, cnr diff --git a/pkg/services/object_manager/tombstone/checker.go b/pkg/services/object_manager/tombstone/checker.go index 66a0ec7d3..d6ccb2631 100644 --- a/pkg/services/object_manager/tombstone/checker.go +++ b/pkg/services/object_manager/tombstone/checker.go @@ -74,8 +74,8 @@ func (g *ExpirationChecker) IsTombstoneAvailable(ctx context.Context, a oid.Addr func (g *ExpirationChecker) handleTS(addr string, ts *objectSDK.Object, reqEpoch uint64) bool { for _, atr := range ts.Attributes() { - if atr.Key() == objectV2.SysAttributeExpEpoch || atr.Key() == objectV2.SysAttributeExpEpochNeoFS { - epoch, err := strconv.ParseUint(atr.Value(), 10, 64) + if atr.GetKey() == objectV2.SysAttributeExpEpoch || atr.GetKey() == objectV2.SysAttributeExpEpochNeoFS { + epoch, err := strconv.ParseUint(atr.GetValue(), 10, 64) if err != nil { g.log.Warn( "tombstone getter: could not parse tombstone expiration epoch", diff --git a/pkg/services/policer/policer_test.go b/pkg/services/policer/policer_test.go index 42428df23..0e46eddbd 100644 --- a/pkg/services/policer/policer_test.go +++ b/pkg/services/policer/policer_test.go @@ -35,7 +35,7 @@ func TestBuryObjectWithoutContainer(t *testing.T) { // Container source and bury function buryCh := make(chan oid.Address) containerSrc := func(id cid.ID) (*container.Container, error) { - return nil, apistatus.ContainerNotFound{} + return nil, apistatus.NewContainerNotFound() } buryFn := func(ctx context.Context, a oid.Address) error { buryCh <- a @@ -153,6 +153,7 @@ func TestProcessObject(t *testing.T) { // Netmap, placement policy and placement builder nodes := make([]netmap.NodeInfo, ti.nodeCount) for i := range nodes { + nodes[i] = netmap.NewNodeInfo() nodes[i].SetPublicKey([]byte{byte(i)}) } for _, i := range ti.maintenanceNodes { @@ -188,7 +189,7 @@ func TestProcessObject(t *testing.T) { return nil, nil } } - return nil, apistatus.ObjectNotFound{} + return nil, apistatus.NewObjectNotFound() } // Container source @@ -200,7 +201,7 @@ func TestProcessObject(t *testing.T) { return cnr, nil } t.Errorf("unexpected container requested: got=%v, want=%v", id, addr.Container()) - return nil, apistatus.ContainerNotFound{} + return nil, apistatus.NewContainerNotFound() } buryFn := func(ctx context.Context, a oid.Address) error { t.Errorf("unexpected object buried: %v", a) @@ -253,7 +254,7 @@ func TestIteratorContract(t *testing.T) { }} containerSrc := func(id cid.ID) (*container.Container, error) { - return nil, apistatus.ContainerNotFound{} + return nil, apistatus.NewContainerNotFound() } buryFn := func(ctx context.Context, a oid.Address) error { return nil diff --git a/pkg/services/session/executor.go b/pkg/services/session/executor.go index 76c220fab..68fca94bd 100644 --- a/pkg/services/session/executor.go +++ b/pkg/services/session/executor.go @@ -4,7 +4,8 @@ import ( "context" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" @@ -12,7 +13,7 @@ import ( ) type ServiceExecutor interface { - Create(context.Context, *session.CreateRequestBody) (*session.CreateResponseBody, error) + Create(context.Context, *sessionGRPC.CreateRequest_Body) (*sessionGRPC.CreateResponse_Body, error) } type executorSvc struct { diff --git a/pkg/services/session/server.go b/pkg/services/session/server.go index 9e44ae667..cfb4eaf3e 100644 --- a/pkg/services/session/server.go +++ b/pkg/services/session/server.go @@ -3,10 +3,10 @@ package session import ( "context" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // Server is an interface of the FrostFS API Session service server. type Server interface { - Create(context.Context, *session.CreateRequest) (*session.CreateResponse, error) + Create(context.Context, *sessionGRPC.CreateRequest) (*sessionGRPC.CreateResponse, error) } diff --git a/pkg/services/session/sign.go b/pkg/services/session/sign.go index 1156dc538..f5eeba62a 100644 --- a/pkg/services/session/sign.go +++ b/pkg/services/session/sign.go @@ -4,7 +4,7 @@ import ( "context" "crypto/ecdsa" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" ) @@ -21,18 +21,18 @@ func NewSignService(key *ecdsa.PrivateKey, svc Server) Server { } } -func (s *signService) Create(ctx context.Context, req *session.CreateRequest) (*session.CreateResponse, error) { +func (s *signService) Create(ctx context.Context, req *sessionGRPC.CreateRequest) (*sessionGRPC.CreateResponse, error) { resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, func(ctx context.Context, req any) (util.ResponseMessage, error) { - return s.svc.Create(ctx, req.(*session.CreateRequest)) + return s.svc.Create(ctx, req.(*sessionGRPC.CreateRequest)) }, func() util.ResponseMessage { - return new(session.CreateResponse) + return new(sessionGRPC.CreateResponse) }, ) if err != nil { return nil, err } - return resp.(*session.CreateResponse), nil + return resp.(*sessionGRPC.CreateResponse), nil } diff --git a/pkg/services/session/storage/persistent/executor.go b/pkg/services/session/storage/persistent/executor.go index 21f55a7d1..b18817792 100644 --- a/pkg/services/session/storage/persistent/executor.go +++ b/pkg/services/session/storage/persistent/executor.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/session/storage" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" @@ -17,15 +17,15 @@ import ( // encrypts private keys if storage has been configured so). // Returns response that is filled with just created token's // ID and public key for it. -func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody) (*session.CreateResponseBody, error) { - idV2 := body.GetOwnerID() +func (s *TokenStore) Create(_ context.Context, body *sessionGRPC.CreateRequest_Body) (*sessionGRPC.CreateResponse_Body, error) { + idV2 := body.GetOwnerId() if idV2 == nil { return nil, errors.New("missing owner") } var id user.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid owner: %w", err) } @@ -65,8 +65,8 @@ func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody) return nil, fmt.Errorf("could not save token to persistent storage: %w", err) } - res := new(session.CreateResponseBody) - res.SetID(uidBytes) + res := new(sessionGRPC.CreateResponse_Body) + res.SetId(uidBytes) res.SetSessionKey(sk.PublicKey().Bytes()) return res, nil diff --git a/pkg/services/session/storage/persistent/executor_test.go b/pkg/services/session/storage/persistent/executor_test.go index 860b95897..26a8d4dc1 100644 --- a/pkg/services/session/storage/persistent/executor_test.go +++ b/pkg/services/session/storage/persistent/executor_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/stretchr/testify/require" @@ -24,11 +24,11 @@ func TestTokenStore(t *testing.T) { owner := *usertest.ID() - var ownerV2 refs.OwnerID + var ownerV2 refsGRPC.OwnerID owner.WriteToV2(&ownerV2) - req := new(session.CreateRequestBody) - req.SetOwnerID(&ownerV2) + req := new(sessionGRPC.CreateRequest_Body) + req.SetOwnerId(&ownerV2) const tokenNumber = 5 @@ -46,7 +46,7 @@ func TestTokenStore(t *testing.T) { require.NoError(t, err) tokens = append(tokens, tok{ - id: res.GetID(), + id: res.GetId(), key: res.GetSessionKey(), }) } @@ -68,19 +68,19 @@ func TestTokenStore_Persistent(t *testing.T) { idOwner := *usertest.ID() - var idOwnerV2 refs.OwnerID + var idOwnerV2 refsGRPC.OwnerID idOwner.WriteToV2(&idOwnerV2) const exp = 12345 - req := new(session.CreateRequestBody) - req.SetOwnerID(&idOwnerV2) + req := new(sessionGRPC.CreateRequest_Body) + req.SetOwnerId(&idOwnerV2) req.SetExpiration(exp) res, err := ts.Create(context.Background(), req) require.NoError(t, err) - id := res.GetID() + id := res.GetId() pubKey := res.GetSessionKey() // close db (stop the node) @@ -129,11 +129,11 @@ func TestTokenStore_RemoveOld(t *testing.T) { owner := *usertest.ID() - var ownerV2 refs.OwnerID + var ownerV2 refsGRPC.OwnerID owner.WriteToV2(&ownerV2) - req := new(session.CreateRequestBody) - req.SetOwnerID(&ownerV2) + req := new(sessionGRPC.CreateRequest_Body) + req.SetOwnerId(&ownerV2) for _, test := range tests { req.SetExpiration(test.epoch) @@ -141,7 +141,7 @@ func TestTokenStore_RemoveOld(t *testing.T) { res, err := ts.Create(context.Background(), req) require.NoError(t, err) - test.id = res.GetID() + test.id = res.GetId() test.key = res.GetSessionKey() } diff --git a/pkg/services/session/storage/temporary/executor.go b/pkg/services/session/storage/temporary/executor.go index cd498709c..019fcdc07 100644 --- a/pkg/services/session/storage/temporary/executor.go +++ b/pkg/services/session/storage/temporary/executor.go @@ -5,22 +5,22 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/session/storage" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" "github.com/mr-tron/base58" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" ) -func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody) (*session.CreateResponseBody, error) { - idV2 := body.GetOwnerID() +func (s *TokenStore) Create(_ context.Context, body *sessionGRPC.CreateRequest_Body) (*sessionGRPC.CreateResponse_Body, error) { + idV2 := body.GetOwnerId() if idV2 == nil { return nil, errors.New("missing owner") } var id user.ID - err := id.ReadFromV2(*idV2) + err := id.ReadFromV2(idV2) if err != nil { return nil, fmt.Errorf("invalid owner: %w", err) } @@ -42,8 +42,8 @@ func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody) }] = storage.NewPrivateToken(&sk.PrivateKey, body.GetExpiration()) s.mtx.Unlock() - res := new(session.CreateResponseBody) - res.SetID(uidBytes) + res := new(sessionGRPC.CreateResponse_Body) + res.SetId(uidBytes) res.SetSessionKey(sk.PublicKey().Bytes()) return res, nil diff --git a/pkg/services/tree/signature.go b/pkg/services/tree/signature.go index 63485a707..3104151c9 100644 --- a/pkg/services/tree/signature.go +++ b/pkg/services/tree/signature.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" core "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" @@ -96,10 +96,10 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op } } - var tb eacl.Table + var tb *eacl.Table signer := req.GetSignature().GetKey() if tableFromBearer && !bt.Impersonate() { - if !bearer.ResolveIssuer(*bt).Equals(cnr.Value.Owner()) { + if !bearer.ResolveIssuer(bt).Equals(cnr.Value.Owner()) { return eACLErr(eaclOp, errBearerWrongOwner) } tb = bt.EACLTable() @@ -108,7 +108,7 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op if err != nil { return handleGetEACLError(err) } - tb = *tbCore.Value + tb = tbCore.Value if bt.Impersonate() { signer = bt.SigningKeyBytes() @@ -174,13 +174,13 @@ func verifyMessage(m message) error { sig := m.GetSignature() // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion - var sigV2 refs.Signature + var sigV2 refsGRPC.Signature sigV2.SetKey(sig.GetKey()) sigV2.SetSign(sig.GetSign()) - sigV2.SetScheme(refs.ECDSA_SHA512) + sigV2.SetScheme(refsGRPC.SignatureScheme_ECDSA_SHA512) - var sigSDK frostfscrypto.Signature - if err := sigSDK.ReadFromV2(sigV2); err != nil { + sigSDK := frostfscrypto.NewSignature() + if err := sigSDK.ReadFromV2(&sigV2); err != nil { return fmt.Errorf("can't read signature: %w", err) } @@ -271,7 +271,7 @@ var errNoAllowRules = errors.New("not found allowing rules for the request") // therefore, filtering leads to unexpected results. // The code was copied with the minor updates from the SDK repo: // https://github.com/nspcc-dev/frostfs-sdk-go/blob/43a57d42dd50dc60465bfd3482f7f12bcfcf3411/eacl/validator.go#L28. -func checkEACL(tb eacl.Table, signer []byte, role eacl.Role, op eacl.Operation) error { +func checkEACL(tb *eacl.Table, signer []byte, role eacl.Role, op eacl.Operation) error { for _, record := range tb.Records() { // check type of operation if record.Operation() != op { diff --git a/pkg/services/tree/signature_test.go b/pkg/services/tree/signature_test.go index eaf9b8b79..352acf43e 100644 --- a/pkg/services/tree/signature_test.go +++ b/pkg/services/tree/signature_test.go @@ -6,7 +6,7 @@ import ( "errors" "testing" - aclV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + aclV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" containercore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/container" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" @@ -64,13 +64,13 @@ func (s dummyEACLSource) GetEACL(id cid.ID) (*containercore.EACL, error) { } func testContainer(owner user.ID) container.Container { - var r netmapSDK.ReplicaDescriptor + r := netmapSDK.NewReplicaDescriptor() r.SetNumberOfObjects(1) var pp netmapSDK.PlacementPolicy pp.AddReplicas(r) - var cnt container.Container + cnt := container.NewContainer() cnt.SetOwner(owner) cnt.SetPlacementPolicy(pp) @@ -230,8 +230,8 @@ func TestMessageSign(t *testing.T) { } func testBearerToken(cid cid.ID, forPutGet, forGet *keys.PublicKey) bearer.Token { - var b bearer.Token - b.SetEACLTable(*testTable(cid, forPutGet, forGet)) + b := bearer.NewToken() + b.SetEACLTable(testTable(cid, forPutGet, forGet)) return b } diff --git a/pkg/services/util/response/service.go b/pkg/services/util/response/service.go index a63d5343b..fb1ff6391 100644 --- a/pkg/services/util/response/service.go +++ b/pkg/services/util/response/service.go @@ -1,8 +1,8 @@ package response import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version" @@ -18,7 +18,7 @@ type Service struct { type Option func(*cfg) type cfg struct { - version refs.Version + version refsGRPC.Version state netmap.State } @@ -48,7 +48,7 @@ func NewService(opts ...Option) *Service { func (s *Service) SetMeta(resp util.ResponseMessage) { meta := new(session.ResponseMetaHeader) meta.SetVersion(&s.cfg.version) - meta.SetTTL(1) // FIXME: #1160 TTL must be calculated + meta.SetTtl(1) // FIXME: #1160 TTL must be calculated meta.SetEpoch(s.cfg.state.CurrentEpoch()) if origin := resp.GetMetaHeader(); origin != nil { diff --git a/pkg/services/util/sign.go b/pkg/services/util/sign.go index cb4be3084..36328597f 100644 --- a/pkg/services/util/sign.go +++ b/pkg/services/util/sign.go @@ -6,19 +6,19 @@ import ( "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + signature "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" ) type RequestMessage interface { - GetMetaHeader() *session.RequestMetaHeader + GetMetaHeader() *sessionGRPC.RequestMetaHeader } // ResponseMessage is an interface of FrostFS response message. type ResponseMessage interface { - GetMetaHeader() *session.ResponseMetaHeader - SetMetaHeader(*session.ResponseMetaHeader) + GetMetaHeader() *sessionGRPC.ResponseMetaHeader + SetMetaHeader(*sessionGRPC.ResponseMetaHeader) } type UnaryHandler func(context.Context, any) (ResponseMessage, error) @@ -185,7 +185,7 @@ func (s *SignService) HandleUnaryRequest(ctx context.Context, req any, handler U // verify request signatures if err = signature.VerifyServiceMessage(req); err != nil { - var sigErr apistatus.SignatureVerification + sigErr := apistatus.NewSignatureVerification() sigErr.SetMessage(err.Error()) err = sigErr @@ -226,7 +226,7 @@ func setStatusV2(resp ResponseMessage, err error) { err = e } - session.SetStatus(resp, apistatus.ToStatusV2(apistatus.ErrToStatus(err))) + sessionGRPC.SetStatus(resp, apistatus.ToStatusV2(apistatus.ErrToStatus(err))) } // signs response with private key via signature.SignServiceMessage. diff --git a/pkg/util/attributes/parser_test.go b/pkg/util/attributes/parser_test.go index 547c8d50b..fe69012a0 100644 --- a/pkg/util/attributes/parser_test.go +++ b/pkg/util/attributes/parser_test.go @@ -9,7 +9,7 @@ import ( ) func testAttributeMap(t *testing.T, mSrc, mExp map[string]string) { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() s := make([]string, 0, len(mSrc)) for k, v := range mSrc { @@ -35,14 +35,14 @@ func testAttributeMap(t *testing.T, mSrc, mExp map[string]string) { func TestParseV2Attributes(t *testing.T) { t.Run("empty", func(t *testing.T) { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() err := attributes.ReadNodeAttributes(&node, nil) require.NoError(t, err) require.Zero(t, node.NumberOfAttributes()) }) t.Run("empty key and/or value", func(t *testing.T) { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() err := attributes.ReadNodeAttributes(&node, []string{ ":HDD", }) @@ -60,7 +60,7 @@ func TestParseV2Attributes(t *testing.T) { }) t.Run("non-unique keys", func(t *testing.T) { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() err := attributes.ReadNodeAttributes(&node, []string{ "StorageType:HDD", "StorageType:HDD", @@ -69,7 +69,7 @@ func TestParseV2Attributes(t *testing.T) { }) t.Run("malformed", func(t *testing.T) { - var node netmap.NodeInfo + node := netmap.NewNodeInfo() err := attributes.ReadNodeAttributes(&node, []string{"..."}) require.Error(t, err)