forked from TrueCloudLab/frostfs-sdk-go
[#170] storagegroup: Refactor and document package functionality
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
1186f2f703
commit
9b63c07c59
5 changed files with 244 additions and 55 deletions
36
storagegroup/doc.go
Normal file
36
storagegroup/doc.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Package storagegroup provides features to work with information that is
|
||||
used for proof of storage in NeoFS system.
|
||||
|
||||
StorageGroup type groups verification values for Data Audit sessions:
|
||||
// receive sg info
|
||||
|
||||
sg.ExpirationEpoch() // expiration of the storage group
|
||||
sg.Members() // objects in the group
|
||||
sg.ValidationDataHash() // hash for objects validation
|
||||
sg.ValidationDataSize() // total objects' payload size
|
||||
|
||||
Instances can be also used to process NeoFS API V2 protocol messages
|
||||
(see neo.fs.v2.storagegroup package in https://github.com/nspcc-dev/neofs-api).
|
||||
|
||||
On client side:
|
||||
import "github.com/nspcc-dev/neofs-api-go/v2/storagegroup"
|
||||
|
||||
var msg storagegroup.StorageGroup
|
||||
sg.WriteToV2(&msg)
|
||||
|
||||
// send msg
|
||||
|
||||
On server side:
|
||||
// recv msg
|
||||
|
||||
var sg StorageGroupDecimal
|
||||
sg.ReadFromV2(msg)
|
||||
|
||||
// process sg
|
||||
|
||||
Using package types in an application is recommended to potentially work with
|
||||
different protocol versions with which these types are compatible.
|
||||
|
||||
*/
|
||||
package storagegroup
|
Loading…
Add table
Add a link
Reference in a new issue