[#234] Update audit result struct definition

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-21 17:35:03 +03:00 committed by Leonard Lyubich
parent 9986a4ecd1
commit 1c25c3904b
8 changed files with 196 additions and 50 deletions

View file

@ -7,6 +7,8 @@ import (
// DataAuditResult is a unified structure of
// DataAuditResult message from proto definition.
type DataAuditResult struct {
version *refs.Version
auditEpoch uint64
hit, miss, fail uint32
@ -18,6 +20,24 @@ type DataAuditResult struct {
passSG, failSG []*refs.ObjectID
failNodes, passNodes [][]byte
complete bool
}
// GetVersion returns version of Data Audit structure.
func (a *DataAuditResult) GetVersion() *refs.Version {
if a != nil {
return a.version
}
return nil
}
// SetVersion sets version of Data Audit structure.
func (a *DataAuditResult) SetVersion(v *refs.Version) {
if a != nil {
a.version = v
}
}
// GetAuditEpoch returns epoch number when the Data Audit was conducted.
@ -195,3 +215,19 @@ func (a *DataAuditResult) SetFailNodes(v [][]byte) {
a.failNodes = v
}
}
// GetComplete returns boolean completion statement of audit result.
func (a *DataAuditResult) GetComplete() bool {
if a != nil {
return a.complete
}
return false // bool default
}
// SetComplete sets boolean completion statement of audit result.
func (a *DataAuditResult) SetComplete(v bool) {
if a != nil {
a.complete = v
}
}