From 076f201807c6d74f37592f7515faa9ee1917efaf Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 22 Dec 2020 03:25:26 +0300 Subject: [PATCH] [#255] services/audit: Define Report structure and Reporter interface Signed-off-by: Leonard Lyubich --- pkg/services/audit/report.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pkg/services/audit/report.go diff --git a/pkg/services/audit/report.go b/pkg/services/audit/report.go new file mode 100644 index 000000000..1d39442ff --- /dev/null +++ b/pkg/services/audit/report.go @@ -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 +}