audit

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	// contains filtered or unexported fields
}

Report tracks the progress of auditing container data.

func NewReport

func NewReport(cnr cid.ID) *Report

NewReport creates and returns blank Report instance.

func (*Report) Complete

func (r *Report) Complete()

Complete completes audit report.

func (*Report) FailedPoR

func (r *Report) FailedPoR(sg oid.ID)

FailedPoR updates list of failed storage groups.

func (*Report) PassedPoR

func (r *Report) PassedPoR(sg oid.ID)

PassedPoR updates list of passed storage groups.

func (*Report) Result

func (r *Report) Result() *Result

Result forms the structure of the data audit result.

func (*Report) SetPDPResults

func (r *Report) SetPDPResults(passed, failed [][]byte)

SetPDPResults sets lists of nodes according to their PDP results.

func (*Report) SetPlacementCounters

func (r *Report) SetPlacementCounters(hit, miss, fail uint32)

SetPlacementCounters sets counters of compliance with placement.

func (*Report) SetPoRCounters

func (r *Report) SetPoRCounters(requests, retries uint32)

SetPoRCounters sets amounts of head requests and retries at PoR audit stage.

type Reporter

type Reporter interface {
	WriteReport(r *Report) error
}

Reporter is an interface of the entity that records the data audit report.

type Result added in v0.43.0

type Result struct {
	// NeoFS epoch when the data audit was performed.
	AuditEpoch uint64
	// Container which data was audited.
	Container cid.ID
	// Binary-encoded public key of the Inner Ring member who conducted the audit.
	AuditorPublicKey []byte
	// Completion flag.
	Completed bool
	// Proof-of-Retrievability check results.
	PoR struct {
		// Number of requests made to get all headers of the objects inside storage
		// groups.
		Requests uint32
		// Number of retries.
		Retries uint32
		// Storage groups for which the check was passed.
		PassedStorageGroups []oid.ID
		// Storage groups for which the check was failed.
		FailedStorageGroups []oid.ID
	}
	// Proof-of-Placement check results.
	PoP struct {
		// Number of sampled objects placed in an optimal way compliant with the
		// Container storage policy.
		Hits uint32
		// Number of objects placed in a suboptimal way according to the Container
		// placement policy, but still at a satisfactory replication level.
		Misses uint32
		// Number of objects stored in a way not confirming to the Container storage
		// policy.
		Failures uint32
	}
	// Proof-of-Data-Possession check results.
	PDP struct {
		// Binary-encoded public keys of sStorage nodes that passed at least one check.
		PassedStorageNodes [][]byte
		// Binary-encoded public keys of sStorage nodes that failed at least one check.
		FailedStorageNodes [][]byte
	}
	// contains filtered or unexported fields
}

Result groups results of the data audit performed by the Inner Ring member.

New instances must be constructed using NewResult.

func NewResult added in v0.43.0

func NewResult(auditorPubKey []byte, epoch uint64, cnr cid.ID) Result

NewResult constructs new audit result for the container performed by subject authenticated with specified binary-encoded public key at the given epoch.

func (Result) Marshal added in v0.43.0

func (r Result) Marshal() []byte

Marshal encodes Result into a Protocol Buffers V3 binary format.

func (*Result) Unmarshal added in v0.43.0

func (r *Result) Unmarshal(data []byte) error

Unmarshal decodes Protocol Buffers V3 binary data into the Result. Returns an error describing a format violation of the specified fields. Unmarshal does not check presence of the required fields and, at the same time, checks format of the presented ones.

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task groups groups the container audit parameters.

func (*Task) AuditContext

func (t *Task) AuditContext() context.Context

AuditContext returns context of the audit of the current epoch.

func (*Task) ContainerID

func (t *Task) ContainerID() cid.ID

ContainerID returns identifier of the container under audit.

func (*Task) ContainerNodes

func (t *Task) ContainerNodes() [][]netmap.NodeInfo

ContainerNodes returns nodes in the container under audit.

func (*Task) ContainerStructure

func (t *Task) ContainerStructure() container.Container

ContainerStructure returns structure of the container under audit.

func (*Task) NetworkMap

func (t *Task) NetworkMap() *netmap.NetMap

NetworkMap returns network map of audit epoch.

func (*Task) Reporter

func (t *Task) Reporter() Reporter

Reporter returns audit report writer.

func (*Task) StorageGroupList

func (t *Task) StorageGroupList() []storagegroup.StorageGroup

StorageGroupList returns list of storage groups from container under audit.

func (*Task) WithAuditContext

func (t *Task) WithAuditContext(ctx context.Context) *Task

WithAuditContext sets context of the audit of the current epoch.

func (*Task) WithContainerID

func (t *Task) WithContainerID(cnr cid.ID) *Task

WithContainerID sets identifier of the container under audit.

func (*Task) WithContainerNodes

func (t *Task) WithContainerNodes(cnrNodes [][]netmap.NodeInfo) *Task

WithContainerNodes sets nodes in the container under audit.

func (*Task) WithContainerStructure

func (t *Task) WithContainerStructure(cnr container.Container) *Task

WithContainerStructure sets structure of the container under audit.

func (*Task) WithNetworkMap

func (t *Task) WithNetworkMap(nm *netmap.NetMap) *Task

WithNetworkMap sets network map of audit epoch.

func (*Task) WithReporter

func (t *Task) WithReporter(r Reporter) *Task

WithReporter sets audit report writer.

func (*Task) WithStorageGroupList

func (t *Task) WithStorageGroupList(sgList []storagegroup.StorageGroup) *Task

WithStorageGroupList sets a list of storage groups from container under audit.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL