Documentation ¶
Overview ¶
Package audit provides features to process data audit in NeoFS system.
Result type groups values which can be gathered during data audit process.
Index ¶
- func CollectMembers(ctx context.Context, collector relations.Executor, cnr cid.ID, ...) (*storagegroup.StorageGroup, error)
- type Result
- func (r Result) AuditorKey() []byte
- func (r *Result) Complete()
- func (r Result) Completed() bool
- func (r Result) Container() (cid.ID, bool)
- func (r Result) Epoch() uint64
- func (r Result) Failures() uint32
- func (r *Result) ForContainer(cnr cid.ID)
- func (r *Result) ForEpoch(epoch uint64)
- func (r Result) Hits() uint32
- func (r Result) IterateFailedStorageGroups(f func(oid.ID) bool)
- func (r Result) IterateFailedStorageNodes(f func([]byte) bool)
- func (r Result) IteratePassedStorageGroups(f func(oid.ID) bool)
- func (r Result) IteratePassedStorageNodes(f func([]byte) bool)
- func (r *Result) Marshal() []byte
- func (r Result) Misses() uint32
- func (r Result) RequestsPoR() uint32
- func (r Result) RetriesPoR() uint32
- func (r *Result) SetAuditorKey(key []byte)
- func (r *Result) SetFailures(fail uint32)
- func (r *Result) SetHits(hit uint32)
- func (r *Result) SetMisses(miss uint32)
- func (r *Result) SetRequestsPoR(v uint32)
- func (r *Result) SetRetriesPoR(v uint32)
- func (r *Result) SubmitFailedStorageGroup(sg oid.ID)
- func (r *Result) SubmitFailedStorageNodes(list [][]byte)
- func (r *Result) SubmitPassedStorageGroup(sg oid.ID)
- func (r *Result) SubmitPassedStorageNodes(list [][]byte)
- func (r *Result) Unmarshal(data []byte) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectMembers ¶
func CollectMembers( ctx context.Context, collector relations.Executor, cnr cid.ID, members []oid.ID, tokens relations.Tokens, calcHomoHash bool, signer user.Signer, ) (*storagegroup.StorageGroup, error)
CollectMembers creates new storage group structure and fills it with information about members collected via HeadReceiver.
Resulting storage group consists of physically stored objects only.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result represents report on the results of the data audit in NeoFS system.
Result is mutually binary-compatible with github.com/epicchainlabs/epicchain-api-go/v2/audit.DataAuditResult message. See Marshal / Unmarshal methods.
Instances can be created using built-in var declaration.
Example ¶
package main import ( "github.com/epicchainlabs/epicchain-sdk-go/audit" cid "github.com/epicchainlabs/epicchain-sdk-go/container/id" ) func main() { var res audit.Result var cnr cid.ID res.ForEpoch(32) res.ForContainer(cnr) // ... res.Complete() // Result instances can be stored in a binary format on client side. data := res.Marshal() // ... // Result instances can be restored from a binary format on server side. var auditResult audit.Result _ = auditResult.Unmarshal(data) }
Output:
func (Result) AuditorKey ¶
AuditorKey returns public key of the auditing NeoFS Inner Ring node in a NeoFS binary key format.
Zero Result has nil key.
The value returned shares memory with the structure itself, so changing it can lead to data corruption. Make a copy if you need to change it.
The resulting slice of bytes is a serialized compressed public key. See [elliptic.MarshalCompressed]. Use [neofsecdsa.PublicKey.Decode] to decode it into a type-specific structure.
See also Result.SetAuditorKey.
func (*Result) Complete ¶
func (r *Result) Complete()
Complete marks the data audit associated with the Result as completed.
See also Completed.
func (Result) Completed ¶
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 ¶
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 ¶
Epoch returns NeoFS epoch when the data associated with the Result was audited.
Zero Result has zero epoch.
See also ForEpoch.
func (Result) Failures ¶
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 ¶
ForContainer sets identifier of the container with which the data audit Result is associated.
See also Container.
func (*Result) ForEpoch ¶
ForEpoch specifies NeoFS epoch when the data associated with the Result was audited.
See also Epoch.
func (Result) Hits ¶
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 ¶
IterateFailedStorageGroups is similar to IteratePassedStorageGroups but for failed groups.
See also SubmitFailedStorageGroup.
func (Result) IterateFailedStorageNodes ¶
IterateFailedStorageNodes is similar to IteratePassedStorageNodes but for failed nodes.
See also SubmitPassedStorageNodes.
func (Result) IteratePassedStorageGroups ¶
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 ¶
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 ¶
Marshal encodes Result into a canonical NeoFS 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 ¶
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 ¶
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 ¶
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 ¶
SetAuditorKey specifies public key of the auditing NeoFS Inner Ring node in a NeoFS binary key format.
Argument MUST NOT be mutated at least until the end of using the Result.
Parameter key is a serialized compressed public key. See [elliptic.MarshalCompressed].
See also Result.AuditorKey.
func (*Result) SetFailures ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SubmitFailedStorageGroup is similar to SubmitPassedStorageGroup but for failed groups.
See also IterateFailedStorageGroups.
func (*Result) SubmitFailedStorageNodes ¶
SubmitFailedStorageNodes is similar to SubmitPassedStorageNodes but for failed nodes.
See also IterateFailedStorageNodes.
func (*Result) SubmitPassedStorageGroup ¶
SubmitPassedStorageGroup marks storage group as passed Proof-of-Retrievability audit check.
See also IteratePassedStorageGroups.
func (*Result) SubmitPassedStorageNodes ¶
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.