From fa8f92d6621faa76b027c451f1dbef7de637d170 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 25 Apr 2024 15:12:32 +0300 Subject: [PATCH] [#75] audit: Remove deprecated service Signed-off-by: Evgenii Stratonikov --- audit/convert.go | 94 ---------------- audit/grpc/types.go | 75 ------------- audit/grpc/types.pb.go | Bin 12413 -> 0 bytes audit/json.go | 14 --- audit/marshal.go | 88 --------------- audit/message_test.go | 15 --- audit/test/generate.go | 29 ----- audit/types.go | 243 ----------------------------------------- 8 files changed, 558 deletions(-) delete mode 100644 audit/convert.go delete mode 100644 audit/grpc/types.go delete mode 100644 audit/grpc/types.pb.go delete mode 100644 audit/json.go delete mode 100644 audit/marshal.go delete mode 100644 audit/message_test.go delete mode 100644 audit/test/generate.go delete mode 100644 audit/types.go diff --git a/audit/convert.go b/audit/convert.go deleted file mode 100644 index a841928..0000000 --- a/audit/convert.go +++ /dev/null @@ -1,94 +0,0 @@ -package audit - -import ( - audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "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-api-go/v2/rpc/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -) - -func (a *DataAuditResult) ToGRPCMessage() grpc.Message { - var m *audit.DataAuditResult - - if a != nil { - m = new(audit.DataAuditResult) - - m.SetAuditEpoch(a.auditEpoch) - m.SetPublicKey(a.pubKey) - m.SetContainerId(a.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) - m.SetComplete(a.complete) - m.SetVersion(a.version.ToGRPCMessage().(*refsGRPC.Version)) - m.SetPassNodes(a.passNodes) - m.SetFailNodes(a.failNodes) - m.SetRetries(a.retries) - m.SetRequests(a.requests) - m.SetHit(a.hit) - m.SetMiss(a.miss) - m.SetFail(a.fail) - m.SetPassSg(refs.ObjectIDListToGRPCMessage(a.passSG)) - m.SetFailSg(refs.ObjectIDListToGRPCMessage(a.failSG)) - } - - return m -} - -func (a *DataAuditResult) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*audit.DataAuditResult) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - cid := v.GetContainerId() - if cid == nil { - a.cid = nil - } else { - if a.cid == nil { - a.cid = new(refs.ContainerID) - } - - err = a.cid.FromGRPCMessage(cid) - if err != nil { - return err - } - } - - version := v.GetVersion() - if version == nil { - a.version = nil - } else { - if a.version == nil { - a.version = new(refs.Version) - } - - err = a.version.FromGRPCMessage(version) - if err != nil { - return err - } - } - - a.passSG, err = refs.ObjectIDListFromGRPCMessage(v.GetPassSg()) - if err != nil { - return err - } - - a.failSG, err = refs.ObjectIDListFromGRPCMessage(v.GetFailSg()) - if err != nil { - return err - } - - a.auditEpoch = v.GetAuditEpoch() - a.pubKey = v.GetPublicKey() - a.complete = v.GetComplete() - a.passNodes = v.GetPassNodes() - a.failNodes = v.GetFailNodes() - a.retries = v.GetRetries() - a.requests = v.GetRequests() - a.hit = v.GetHit() - a.miss = v.GetMiss() - a.fail = v.GetFail() - - return err -} diff --git a/audit/grpc/types.go b/audit/grpc/types.go deleted file mode 100644 index 59bb184..0000000 --- a/audit/grpc/types.go +++ /dev/null @@ -1,75 +0,0 @@ -package audit - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetVersion is a Version field setter. -func (x *DataAuditResult) SetVersion(v *refs.Version) { - x.Version = v -} - -// SetAuditEpoch is an AuditEpoch field setter. -func (x *DataAuditResult) SetAuditEpoch(v uint64) { - x.AuditEpoch = v -} - -// SetContainerId is a ContainerId field setter. -func (x *DataAuditResult) SetContainerId(v *refs.ContainerID) { - x.ContainerId = v -} - -// SetPublicKey is a PublicKey field setter. -func (x *DataAuditResult) SetPublicKey(v []byte) { - x.PublicKey = v -} - -// SetComplete is a Complete field setter. -func (x *DataAuditResult) SetComplete(v bool) { - x.Complete = v -} - -// SetRequests is a Requests field setter. -func (x *DataAuditResult) SetRequests(v uint32) { - x.Requests = v -} - -// SetRetries is a Retries field setter. -func (x *DataAuditResult) SetRetries(v uint32) { - x.Retries = v -} - -// SetPassSg is a PassSg field setter. -func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) { - x.PassSg = v -} - -// SetFailSg is a FailSg field setter. -func (x *DataAuditResult) SetFailSg(v []*refs.ObjectID) { - x.FailSg = v -} - -// SetHit is a Hit field setter. -func (x *DataAuditResult) SetHit(v uint32) { - x.Hit = v -} - -// SetMiss is a Miss field setter. -func (x *DataAuditResult) SetMiss(v uint32) { - x.Miss = v -} - -// SetFail is a Fail field setter. -func (x *DataAuditResult) SetFail(v uint32) { - x.Fail = v -} - -// SetPassNodes is a PassNodes field setter. -func (x *DataAuditResult) SetPassNodes(v [][]byte) { - x.PassNodes = v -} - -// SetFailNodes is a FailNodes field setter. -func (x *DataAuditResult) SetFailNodes(v [][]byte) { - x.FailNodes = v -} diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go deleted file mode 100644 index 57243ef010cf3d22b659dd6dc44f26b94461b627..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12413 zcmb_iYjfI27X6HVMUOwEU<%8;j5BO`t7c;->)J^|*_o}Wotp9p(O^wLVkJTFru^Uc z+NDH5yh#hJ2fIzXVV~cCvlXdlf(_eNp$fkUg|fqXgU7L z8(o;0b8is<{l%(t5$j39TFx9ni-DQ;Q%H)U=}f!RXy%1eH;Shhj9|2!5EIeJfccT} z1JJCTc^Rg`TnjT%gL9)a7nVGSFo!BC9q|<7U=}>&*rQVN}5cfJ+&QkSR>qVks?MLxgMH2<@jF&!TC{ZdV zOd>iQ5II&26w#OZId2Wv~wj*G31b!tUbJgu+ zf?Nz%u%L-_(Af<6<;UTjngyfSi=SEAGJzw~DDy?ptzzmjraZ~Q@IBR)oBjGdtAWAU z=sDF%v)zmqX*2ZZ`r06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