forked from TrueCloudLab/frostfs-sdk-go
[#4] Rename NeoFS mentions in comments and method names
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
b204a62da1
commit
4ff9c00de3
75 changed files with 423 additions and 423 deletions
|
@ -6,9 +6,9 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// Basic represents basic part of the NeoFS container's ACL. It includes
|
||||
// Basic represents basic part of the FrostFS container's ACL. It includes
|
||||
// common (pretty simple) access rules for operations inside the container.
|
||||
// See NeoFS Specification for details.
|
||||
// See FrostFS Specification for details.
|
||||
//
|
||||
// One can find some similarities with the traditional Unix permission, such as
|
||||
//
|
||||
|
@ -236,7 +236,7 @@ const (
|
|||
NamePublicAppendExtended = "eacl-public-append"
|
||||
)
|
||||
|
||||
// Frequently used Basic values. Bitmasks are taken from the NeoFS Specification.
|
||||
// Frequently used Basic values. Bitmasks are taken from the FrostFS Specification.
|
||||
const (
|
||||
Private = Basic(0x1C8C8CCC) // private
|
||||
PrivateExtended = Basic(0x0C8C8CCC) // eacl-private
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Package acl provides functionality to control access to data and operations on them in NeoFS containers.
|
||||
Package acl provides functionality to control access to data and operations on them in FrostFS containers.
|
||||
|
||||
Type Basic represents basic ACL of the NeoFS container which specifies the general order of data access.
|
||||
Type Basic represents basic ACL of the FrostFS container which specifies the general order of data access.
|
||||
Basic provides interface of rule composition. Package acl also exports some frequently used settings like
|
||||
private or public.
|
||||
*/
|
||||
|
|
|
@ -22,17 +22,17 @@ import (
|
|||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Container represents descriptor of the NeoFS container. Container logically
|
||||
// stores NeoFS objects. Container is one of the basic and at the same time
|
||||
// necessary data storage units in the NeoFS. Container includes data about the
|
||||
// Container represents descriptor of the FrostFS container. Container logically
|
||||
// stores FrostFS objects. Container is one of the basic and at the same time
|
||||
// necessary data storage units in the FrostFS. Container includes data about the
|
||||
// owner, rules for placing objects and other information necessary for the
|
||||
// system functioning.
|
||||
//
|
||||
// Container type instances can represent different container states in the
|
||||
// system, depending on the context. To create new container in NeoFS zero
|
||||
// system, depending on the context. To create new container in FrostFS zero
|
||||
// instance SHOULD be declared, initialized using Init method and filled using
|
||||
// dedicated methods. Once container is saved in the NeoFS network, it can't be
|
||||
// changed: containers stored in the system are immutable, and NeoFS is a CAS
|
||||
// dedicated methods. Once container is saved in the FrostFS network, it can't be
|
||||
// changed: containers stored in the system are immutable, and FrostFS is a CAS
|
||||
// of containers that are identified by a fixed length value (see cid.ID type).
|
||||
// Instances for existing containers can be initialized using decoding methods
|
||||
// (e.g Unmarshal).
|
||||
|
@ -137,7 +137,7 @@ func (x *Container) readFromV2(m container.Container, checkFieldPresence bool) e
|
|||
}
|
||||
|
||||
// ReadFromV2 reads Container from the container.Container message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (x *Container) ReadFromV2(m container.Container) error {
|
||||
|
@ -152,7 +152,7 @@ func (x Container) WriteToV2(m *container.Container) {
|
|||
*m = x.v2
|
||||
}
|
||||
|
||||
// Marshal encodes Container into a binary format of the NeoFS API protocol
|
||||
// Marshal encodes Container into a binary format of the FrostFS API protocol
|
||||
// (Protocol Buffers with direct field order).
|
||||
//
|
||||
// See also Unmarshal.
|
||||
|
@ -160,7 +160,7 @@ func (x Container) Marshal() []byte {
|
|||
return x.v2.StableMarshal(nil)
|
||||
}
|
||||
|
||||
// Unmarshal decodes NeoFS API protocol binary format into the Container
|
||||
// Unmarshal decodes FrostFS API protocol binary format into the Container
|
||||
// (Protocol Buffers with direct field order). Returns an error describing
|
||||
// a format violation.
|
||||
//
|
||||
|
@ -176,7 +176,7 @@ func (x *Container) Unmarshal(data []byte) error {
|
|||
return x.readFromV2(m, false)
|
||||
}
|
||||
|
||||
// MarshalJSON encodes Container into a JSON format of the NeoFS API protocol
|
||||
// MarshalJSON encodes Container into a JSON format of the FrostFS API protocol
|
||||
// (Protocol Buffers JSON).
|
||||
//
|
||||
// See also UnmarshalJSON.
|
||||
|
@ -184,7 +184,7 @@ func (x Container) MarshalJSON() ([]byte, error) {
|
|||
return x.v2.MarshalJSON()
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes NeoFS API protocol JSON format into the Container
|
||||
// UnmarshalJSON decodes FrostFS API protocol JSON format into the Container
|
||||
// (Protocol Buffers JSON). Returns an error describing a format violation.
|
||||
//
|
||||
// See also MarshalJSON.
|
||||
|
@ -192,7 +192,7 @@ func (x *Container) UnmarshalJSON(data []byte) error {
|
|||
return x.v2.UnmarshalJSON(data)
|
||||
}
|
||||
|
||||
// Init initializes all internal data of the Container required by NeoFS API
|
||||
// Init initializes all internal data of the Container required by FrostFS API
|
||||
// protocol. Init MUST be called when creating a new container. Init SHOULD NOT
|
||||
// be called multiple times. Init SHOULD NOT be called if the Container instance
|
||||
// is used for decoding only.
|
||||
|
@ -212,7 +212,7 @@ func (x *Container) Init() {
|
|||
|
||||
// SetOwner specifies the owner of the Container. Each Container has exactly
|
||||
// one owner, so SetOwner MUST be called for instances to be saved in the
|
||||
// NeoFS.
|
||||
// FrostFS.
|
||||
//
|
||||
// See also Owner.
|
||||
func (x *Container) SetOwner(owner user.ID) {
|
||||
|
@ -224,7 +224,7 @@ func (x *Container) SetOwner(owner user.ID) {
|
|||
|
||||
// Owner returns owner of the Container set using SetOwner.
|
||||
//
|
||||
// Zero Container has no owner which is incorrect according to NeoFS API
|
||||
// Zero Container has no owner which is incorrect according to FrostFS API
|
||||
// protocol.
|
||||
func (x Container) Owner() (res user.ID) {
|
||||
m := x.v2.GetOwnerID()
|
||||
|
@ -256,7 +256,7 @@ func (x Container) BasicACL() (res acl.Basic) {
|
|||
}
|
||||
|
||||
// SetPlacementPolicy sets placement policy for the objects within the Container.
|
||||
// NeoFS storage layer strives to follow the specified policy.
|
||||
// FrostFS storage layer strives to follow the specified policy.
|
||||
//
|
||||
// See also PlacementPolicy.
|
||||
func (x *Container) SetPlacementPolicy(policy netmap.PlacementPolicy) {
|
||||
|
@ -269,7 +269,7 @@ func (x *Container) SetPlacementPolicy(policy netmap.PlacementPolicy) {
|
|||
// PlacementPolicy returns placement policy set using SetPlacementPolicy.
|
||||
//
|
||||
// Zero Container has no placement policy which is incorrect according to
|
||||
// NeoFS API protocol.
|
||||
// FrostFS API protocol.
|
||||
func (x Container) PlacementPolicy() (res netmap.PlacementPolicy) {
|
||||
m := x.v2.GetPlacementPolicy()
|
||||
if m != nil {
|
||||
|
@ -284,7 +284,7 @@ func (x Container) PlacementPolicy() (res netmap.PlacementPolicy) {
|
|||
|
||||
// SetAttribute sets Container attribute value by key. Both key and value
|
||||
// MUST NOT be empty. Attributes set by the creator (owner) are most commonly
|
||||
// ignored by the NeoFS system and used for application layer. Some attributes
|
||||
// ignored by the FrostFS system and used for application layer. Some attributes
|
||||
// are so-called system or well-known attributes: they are reserved for system
|
||||
// needs. System attributes SHOULD NOT be modified using SetAttribute, use
|
||||
// corresponding methods/functions. List of the reserved keys is documented
|
||||
|
@ -383,7 +383,7 @@ func CreatedAt(cnr Container) time.Time {
|
|||
return time.Unix(sec, 0)
|
||||
}
|
||||
|
||||
// SetSubnet places the Container on the specified NeoFS subnet. If called,
|
||||
// SetSubnet places the Container on the specified FrostFS subnet. If called,
|
||||
// container nodes will only be selected from the given subnet, otherwise from
|
||||
// the entire network.
|
||||
func SetSubnet(cnr *Container, subNet subnetid.ID) {
|
||||
|
@ -423,7 +423,7 @@ func IsHomomorphicHashingDisabled(cnr Container) bool {
|
|||
}
|
||||
|
||||
// Domain represents information about container domain registered in the NNS
|
||||
// contract deployed in the NeoFS network.
|
||||
// contract deployed in the FrostFS network.
|
||||
type Domain struct {
|
||||
name, zone string
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ func ReadDomain(cnr Container) (res Domain) {
|
|||
// CalculateSignature calculates signature of the Container using provided signer
|
||||
// and writes it into dst. Signature instance MUST NOT be nil. CalculateSignature
|
||||
// is expected to be called after all the Container data is filled and before
|
||||
// saving the Container in the NeoFS network. Note that мany subsequent change
|
||||
// saving the Container in the FrostFS network. Note that мany subsequent change
|
||||
// will most likely break the signature.
|
||||
//
|
||||
// See also VerifySignature.
|
||||
|
@ -492,7 +492,7 @@ func VerifySignature(sig frostfscrypto.Signature, cnr Container) bool {
|
|||
}
|
||||
|
||||
// CalculateIDFromBinary calculates identifier of the binary-encoded container
|
||||
// in CAS of the NeoFS containers and writes it into dst. ID instance MUST NOT
|
||||
// in CAS of the FrostFS containers and writes it into dst. ID instance MUST NOT
|
||||
// be nil.
|
||||
//
|
||||
// See also CalculateID, AssertID.
|
||||
|
@ -509,7 +509,7 @@ func CalculateID(dst *cid.ID, cnr Container) {
|
|||
}
|
||||
|
||||
// AssertID checks if the given Container matches its identifier in CAS of the
|
||||
// NeoFS containers.
|
||||
// FrostFS containers.
|
||||
//
|
||||
// See also CalculateID.
|
||||
func AssertID(id cid.ID, cnr Container) bool {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Package container provides functionality related to the NeoFS containers.
|
||||
Package container provides functionality related to the FrostFS containers.
|
||||
|
||||
The base type is Container. To create new container in the NeoFS network
|
||||
The base type is Container. To create new container in the FrostFS network
|
||||
Container instance should be initialized
|
||||
|
||||
var cnr Container
|
||||
|
@ -10,7 +10,7 @@ Container instance should be initialized
|
|||
|
||||
// encode cnr and send
|
||||
|
||||
After the container is persisted in the NeoFS network, applications can process
|
||||
After the container is persisted in the FrostFS network, applications can process
|
||||
it using the instance of Container types
|
||||
|
||||
// recv binary container
|
||||
|
@ -22,7 +22,7 @@ it using the instance of Container types
|
|||
|
||||
// process the container data
|
||||
|
||||
Instances can be also used to process NeoFS API V2 protocol messages
|
||||
Instances can be also used to process FrostFS API V2 protocol messages
|
||||
(see neo.fs.v2.container package in https://github.com/TrueCloudLab/frostfs-api).
|
||||
|
||||
On client side:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package cid provides primitives to work with container identification in NeoFS.
|
||||
Package cid provides primitives to work with container identification in FrostFS.
|
||||
|
||||
Using package types in an application is recommended to potentially work with
|
||||
different protocol versions with which these types are compatible.
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/mr-tron/base58"
|
||||
)
|
||||
|
||||
// ID represents NeoFS container identifier.
|
||||
// ID represents FrostFS container identifier.
|
||||
//
|
||||
// ID is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/refs.ContainerID
|
||||
// message. See ReadFromV2 / WriteToV2 methods.
|
||||
|
@ -22,7 +22,7 @@ type ID [sha256.Size]byte
|
|||
|
||||
// ReadFromV2 reads ID from the refs.ContainerID message.
|
||||
// Returns an error if the message is malformed according
|
||||
// to the NeoFS API V2 protocol.
|
||||
// to the FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (id *ID) ReadFromV2(m refs.ContainerID) error {
|
||||
|
@ -83,7 +83,7 @@ func (id ID) Equals(id2 ID) bool {
|
|||
return id == id2
|
||||
}
|
||||
|
||||
// EncodeToString encodes ID into NeoFS API protocol string.
|
||||
// EncodeToString encodes ID into FrostFS API protocol string.
|
||||
//
|
||||
// Zero ID is base58 encoding of 32 zeros.
|
||||
//
|
||||
|
@ -92,7 +92,7 @@ func (id ID) EncodeToString() string {
|
|||
return base58.Encode(id[:])
|
||||
}
|
||||
|
||||
// DecodeString decodes string into ID according to NeoFS API protocol. Returns
|
||||
// DecodeString decodes string into ID according to FrostFS API protocol. Returns
|
||||
// an error if s is malformed.
|
||||
//
|
||||
// See also DecodeString.
|
||||
|
@ -109,7 +109,7 @@ func (id *ID) DecodeString(s string) error {
|
|||
//
|
||||
// String is designed to be human-readable, and its format MAY differ between
|
||||
// SDK versions. String MAY return same result as EncodeToString. String MUST NOT
|
||||
// be used to encode ID into NeoFS protocol string.
|
||||
// be used to encode ID into FrostFS protocol string.
|
||||
func (id ID) String() string {
|
||||
return id.EncodeToString()
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
// SizeEstimation groups information about estimation of the size of the data
|
||||
// stored in the NeoFS container.
|
||||
// stored in the FrostFS container.
|
||||
//
|
||||
// SizeEstimation is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/container.UsedSpaceAnnouncement
|
||||
// message. See ReadFromV2 / WriteToV2 methods.
|
||||
|
@ -19,7 +19,7 @@ type SizeEstimation struct {
|
|||
}
|
||||
|
||||
// ReadFromV2 reads SizeEstimation from the container.UsedSpaceAnnouncement message.
|
||||
// Checks if the message conforms to NeoFS API V2 protocol.
|
||||
// Checks if the message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (x *SizeEstimation) ReadFromV2(m container.UsedSpaceAnnouncement) error {
|
||||
|
@ -63,7 +63,7 @@ func (x SizeEstimation) Epoch() uint64 {
|
|||
}
|
||||
|
||||
// SetContainer specifies the container for which the amount of data is estimated.
|
||||
// Required by the NeoFS API protocol.
|
||||
// Required by the FrostFS API protocol.
|
||||
//
|
||||
// See also Container.
|
||||
func (x *SizeEstimation) SetContainer(cnr cid.ID) {
|
||||
|
@ -76,7 +76,7 @@ func (x *SizeEstimation) SetContainer(cnr cid.ID) {
|
|||
// Container returns container set using SetContainer.
|
||||
//
|
||||
// Zero SizeEstimation is not bound to any container (returns zero) which is
|
||||
// incorrect according to NeoFS API protocol.
|
||||
// incorrect according to FrostFS API protocol.
|
||||
func (x SizeEstimation) Container() (res cid.ID) {
|
||||
m := x.m.GetContainerID()
|
||||
if m != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue