audit

package
v0.0.0-...-5e759bf Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Package audit provides features to process data audit in FrostFS system.

Result type groups values which can be gathered during data audit process:

var res audit.Result
res.ForEpoch(32)
res.ForContainer(cnr)
// ...
res.Complete()

Result instances can be stored in a binary format. On reporter side:

data := res.Marshal()
// send data

On receiver side:

var res audit.Result
err := res.Unmarshal(data)
// ...

Using package types in an application is recommended to potentially work with different protocol versions with which these types are compatible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

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

Result represents report on the results of the data audit in FrostFS system.

Result is mutually binary-compatible with github.com/TrueCloudLab/frostfs-api-go/v2/audit.DataAuditResult message. See Marshal / Unmarshal methods.

Instances can be created using built-in var declaration.

func (Result) AuditorKey

func (r Result) AuditorKey() []byte

AuditorKey returns public key of the auditing FrostFS Inner Ring node in a FrostFS binary key format.

Zero Result has nil key. Return value MUST NOT be mutated: to do this, first make a copy.

See also SetAuditorPublicKey.

func (*Result) Complete

func (r *Result) Complete()

Complete marks the data audit associated with the Result as completed.

See also Completed.

func (Result) Completed

func (r Result) Completed() bool

Completed returns completion state of the data audit associated with the Result.

Zero Result corresponds to incomplete data audit.

See also Complete.

func (Result) Container

func (r Result) Container() (cid.ID, bool)

Container returns identifier of the container with which the data audit Result is associated and a bool that indicates container ID field presence in the Result.

Zero Result does not have container ID.

See also ForContainer.

func (Result) Epoch

func (r Result) Epoch() uint64

Epoch returns FrostFS epoch when the data associated with the Result was audited.

Zero Result has zero epoch.

See also ForEpoch.

func (Result) Failures

func (r Result) Failures() uint32

Failures returns number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking Proof-of-Placement.

Zero result has zero failures.

See also SetFailures.

func (*Result) ForContainer

func (r *Result) ForContainer(cnr cid.ID)

ForContainer sets identifier of the container with which the data audit Result is associated.

See also Container.

func (*Result) ForEpoch

func (r *Result) ForEpoch(epoch uint64)

ForEpoch specifies FrostFS epoch when the data associated with the Result was audited.

See also Epoch.

func (Result) Hits

func (r Result) Hits() uint32

Hits returns number of sampled objects under audit placed in an optimal way according to the container's placement policy when checking Proof-of-Placement.

Zero result has zero hits.

See also SetHits.

func (Result) IterateFailedStorageGroups

func (r Result) IterateFailedStorageGroups(f func(oid.ID) bool)

IterateFailedStorageGroups is similar to IteratePassedStorageGroups but for failed groups.

See also SubmitFailedStorageGroup.

func (Result) IterateFailedStorageNodes

func (r Result) IterateFailedStorageNodes(f func([]byte) bool)

IterateFailedStorageNodes is similar to IteratePassedStorageNodes but for failed nodes.

See also SubmitPassedStorageNodes.

func (Result) IteratePassedStorageGroups

func (r Result) IteratePassedStorageGroups(f func(oid.ID) bool)

IteratePassedStorageGroups iterates over all storage groups that passed Proof-of-Retrievability audit check and passes them into f. Breaks on f's false return, f MUST NOT be nil.

Zero Result has no passed storage groups and doesn't call f.

See also SubmitPassedStorageGroup.

func (Result) IteratePassedStorageNodes

func (r Result) IteratePassedStorageNodes(f func([]byte) bool)

IteratePassedStorageNodes iterates over all storage nodes that passed at least one Proof-of-Data-Possession audit check and passes their public keys into f. Breaks on f's false return.

f MUST NOT be nil and MUST NOT mutate parameter passed into it at least until the end of using the Result.

Zero Result has no passed storage nodes and doesn't call f.

See also SubmitPassedStorageNode.

func (*Result) Marshal

func (r *Result) Marshal() []byte

Marshal encodes Result into a canonical FrostFS binary format (Protocol Buffers with direct field order).

Writes version.Current() protocol version into the resulting message if Result hasn't been already decoded from such a message using Unmarshal.

See also Unmarshal.

func (Result) Misses

func (r Result) Misses() uint32

Misses returns number of sampled objects under audit placed in suboptimal way according to the container's placement policy, but still at a satisfactory level when checking Proof-of-Placement.

Zero Result has zero misses.

See also SetMisses.

func (Result) RequestsPoR

func (r Result) RequestsPoR() uint32

RequestsPoR returns number of requests made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.

Zero Result has zero requests.

See also SetRequestsPoR.

func (Result) RetriesPoR

func (r Result) RetriesPoR() uint32

RetriesPoR returns number of retries made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.

Zero Result has zero retries.

See also SetRetriesPoR.

func (*Result) SetAuditorKey

func (r *Result) SetAuditorKey(key []byte)

SetAuditorKey specifies public key of the auditing FrostFS Inner Ring node in a FrostFS binary key format.

Argument MUST NOT be mutated at least until the end of using the Result.

See also AuditorKey.

func (*Result) SetFailures

func (r *Result) SetFailures(fail uint32)

SetFailures sets number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking Proof-of-Placement.

See also Failures.

func (*Result) SetHits

func (r *Result) SetHits(hit uint32)

SetHits sets number of sampled objects under audit placed in an optimal way according to the containers placement policy when checking Proof-of-Placement.

See also Hits.

func (*Result) SetMisses

func (r *Result) SetMisses(miss uint32)

SetMisses sets number of sampled objects under audit placed in suboptimal way according to the container's placement policy, but still at a satisfactory level when checking Proof-of-Placement.

See also Misses.

func (*Result) SetRequestsPoR

func (r *Result) SetRequestsPoR(v uint32)

SetRequestsPoR sets number of requests made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.

See also RequestsPoR.

func (*Result) SetRetriesPoR

func (r *Result) SetRetriesPoR(v uint32)

SetRetriesPoR sets number of retries made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.

See also RetriesPoR.

func (*Result) SubmitFailedStorageGroup

func (r *Result) SubmitFailedStorageGroup(sg oid.ID)

SubmitFailedStorageGroup is similar to SubmitPassedStorageGroup but for failed groups.

See also IterateFailedStorageGroups.

func (*Result) SubmitFailedStorageNodes

func (r *Result) SubmitFailedStorageNodes(list [][]byte)

SubmitFailedStorageNodes is similar to SubmitPassedStorageNodes but for failed nodes.

See also IterateFailedStorageNodes.

func (*Result) SubmitPassedStorageGroup

func (r *Result) SubmitPassedStorageGroup(sg oid.ID)

SubmitPassedStorageGroup marks storage group as passed Proof-of-Retrievability audit check.

See also IteratePassedStorageGroups.

func (*Result) SubmitPassedStorageNodes

func (r *Result) SubmitPassedStorageNodes(list [][]byte)

SubmitPassedStorageNodes marks storage node list as passed Proof-of-Data-Possession audit check. The list contains public keys.

Argument and its elements MUST NOT be mutated at least until the end of using the Result.

See also IteratePassedStorageNodes.

func (*Result) Unmarshal

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

Unmarshal decodes Result from its canonical FrostFS binary format (Protocol Buffers with direct field order). Returns an error describing a format violation.

See also Marshal.

Directories

Path Synopsis
Package audittest provides functions for convenient testing of audit package API.
Package audittest provides functions for convenient testing of audit package API.

Jump to

Keyboard shortcuts

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