[#255] services/audit: Define Report structure and Reporter interface
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
919f4364f1
commit
076f201807
1 changed files with 33 additions and 0 deletions
33
pkg/services/audit/report.go
Normal file
33
pkg/services/audit/report.go
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package audit
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/nspcc-dev/neofs-api-go/pkg/audit"
|
||||||
|
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Report tracks the progress of auditing container data.
|
||||||
|
type Report struct {
|
||||||
|
res *audit.Result
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reporter is an interface of the entity that records
|
||||||
|
// the data audit report.
|
||||||
|
type Reporter interface {
|
||||||
|
WriteReport(r *Report) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewReport creates and returns blank Report instance.
|
||||||
|
func NewReport(cid *container.ID) *Report {
|
||||||
|
rep := &Report{
|
||||||
|
res: audit.NewResult(),
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.res.SetContainerID(cid)
|
||||||
|
|
||||||
|
return rep
|
||||||
|
}
|
||||||
|
|
||||||
|
// Result forms the structure of the data audit result.
|
||||||
|
func (r *Report) Result() *audit.Result {
|
||||||
|
return r.res
|
||||||
|
}
|
Loading…
Reference in a new issue