[#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
28
README.md
28
README.md
|
@ -1,5 +1,5 @@
|
|||
# frostfs-sdk-go
|
||||
Go implementation of NeoFS SDK. It contains high-level version-independent wrappers
|
||||
Go implementation of FrostFS SDK. It contains high-level version-independent wrappers
|
||||
for structures from [frostfs-api-go](https://github.com/TrueCloudLab/frostfs-api-go) as well as
|
||||
helper functions for simplifying node/dApp implementations.
|
||||
|
||||
|
@ -10,39 +10,39 @@ Contains fixed-point `Decimal` type for performing balance calculations.
|
|||
|
||||
### eacl
|
||||
Contains Extended ACL types for fine-grained access control.
|
||||
There is also a reference implementation of checking algorithm which is used in NeoFS node.
|
||||
There is also a reference implementation of checking algorithm which is used in FrostFS node.
|
||||
|
||||
### checksum
|
||||
Contains `Checksum` type encapsulating checksum as well as it's kind.
|
||||
Currently Sha256 and [Tillich-Zemor hashsum](https://github.com/TrueCloudLab/tzhash) are in use.
|
||||
|
||||
### owner
|
||||
`owner.ID` type represents single account interacting with NeoFS. In v2 version of protocol
|
||||
`owner.ID` type represents single account interacting with FrostFS. In v2 version of protocol
|
||||
it is just raw bytes behing [base58-encoded address](https://docs.neo.org/docs/en-us/basic/concept/wallets.html#address)
|
||||
in Neo blockchain. Note that for historical reasons it contains
|
||||
version prefix and checksum in addition to script-hash.
|
||||
|
||||
### token
|
||||
Contains Bearer token type with several NeoFS-specific methods.
|
||||
Contains Bearer token type with several FrostFS-specific methods.
|
||||
|
||||
### ns
|
||||
In NeoFS there are 2 types of name resolution: DNS and NNS. NNS stands for Neo Name Service
|
||||
In FrostFS there are 2 types of name resolution: DNS and NNS. NNS stands for Neo Name Service
|
||||
is just a [contract](https://github.com/TrueCloudLab/frostfs-contract) deployed on a Neo blockchain.
|
||||
Basically, NNS is just a DNS-on-chain which can be used for resolving container nice-names as well
|
||||
as any other name in dApps. See our [CoreDNS plugin](https://github.com/nspcc-dev/coredns/tree/master/plugin/nns)
|
||||
for the example of how NNS can be integrated in DNS.
|
||||
|
||||
### session
|
||||
To help lightweight clients interact with NeoFS without sacrificing trust, NeoFS has a concept
|
||||
To help lightweight clients interact with FrostFS without sacrificing trust, FrostFS has a concept
|
||||
of session token. It is signed by client and allows any node with which a session is established
|
||||
to perform certain actions on behalf of the user.
|
||||
|
||||
### client
|
||||
Contains client for working with NeoFS.
|
||||
Contains client for working with FrostFS.
|
||||
```go
|
||||
var prmInit client.PrmInit
|
||||
prmInit.SetDefaultPrivateKey(key) // private key for request signing
|
||||
prmInit.ResolveNeoFSFailures() // enable erroneous status parsing
|
||||
prmInit.ResolveFrostFSFailures() // enable erroneous status parsing
|
||||
|
||||
var c client.Client
|
||||
c.Init(prmInit)
|
||||
|
@ -70,15 +70,15 @@ fmt.Printf("Balance for %s: %v\n", acc, res.Amount())
|
|||
```
|
||||
|
||||
#### Response status
|
||||
In NeoFS every operation can fail on multiple levels, so a single `error` doesn't suffice,
|
||||
In FrostFS every operation can fail on multiple levels, so a single `error` doesn't suffice,
|
||||
e.g. consider a case when object was put on 4 out of 5 replicas. Thus, all request execution
|
||||
details are contained in `Status` returned from every RPC call. dApp can inspect them
|
||||
if needed and perform any desired action. In the case above we may want to report
|
||||
these details to the user as well as retry an operation, possibly with different parameters.
|
||||
Status wire-format is extendable and each node can report any set of details it wants.
|
||||
The set of reserved status codes can be found in
|
||||
[NeoFS API](https://github.com/TrueCloudLab/frostfs-api/blob/master/status/types.proto). There is also
|
||||
a `client.PrmInit.ResolveNeoFSFailures()` to seamlessly convert erroneous statuses into Go error type.
|
||||
[FrostFS API](https://github.com/TrueCloudLab/frostfs-api/blob/master/status/types.proto). There is also
|
||||
a `client.PrmInit.ResolveFrostFSFailures()` to seamlessly convert erroneous statuses into Go error type.
|
||||
|
||||
### policy
|
||||
Contains helpers allowing conversion of placing policy from/to JSON representation
|
||||
|
@ -107,7 +107,7 @@ import (
|
|||
)
|
||||
|
||||
func placementNodes(addr *object.Address, p *netmap.PlacementPolicy, frostfsNodes []netmap.NodeInfo) {
|
||||
// Convert list of nodes in NeoFS API format to the intermediate representation.
|
||||
// Convert list of nodes in FrostFS API format to the intermediate representation.
|
||||
nodes := netmap.NodesFromInfo(nodes)
|
||||
|
||||
// Create new netmap (errors are skipped for the sake of clarity).
|
||||
|
@ -122,13 +122,13 @@ func placementNodes(addr *object.Address, p *netmap.PlacementPolicy, frostfsNode
|
|||
```
|
||||
|
||||
### pool
|
||||
Simple pool for managing connections to NeoFS nodes.
|
||||
Simple pool for managing connections to FrostFS nodes.
|
||||
|
||||
### acl, checksum, version, signature
|
||||
Contain simple API wrappers.
|
||||
|
||||
### logger
|
||||
Wrapper over `zap.Logger` which is used across NeoFS codebase.
|
||||
Wrapper over `zap.Logger` which is used across FrostFS codebase.
|
||||
|
||||
### util
|
||||
Utilities for working with signature-related code.
|
|
@ -15,7 +15,7 @@ import "github.com/TrueCloudLab/frostfs-api-go/v2/accounting"
|
|||
type Decimal accounting.Decimal
|
||||
|
||||
// ReadFromV2 reads Decimal from the accounting.Decimal message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (d *Decimal) ReadFromV2(m accounting.Decimal) error {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package accounting provides primitives to perform accounting operations in NeoFS.
|
||||
Package accounting provides primitives to perform accounting operations in FrostFS.
|
||||
|
||||
Decimal type provides functionality to process user balances. For example, when
|
||||
working with Fixed8 balance precision:
|
||||
|
@ -8,7 +8,7 @@ working with Fixed8 balance precision:
|
|||
dec.SetValue(val)
|
||||
dec.SetPrecision(8)
|
||||
|
||||
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.accounting package in https://github.com/TrueCloudLab/frostfs-api).
|
||||
|
||||
On client side:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package audit provides features to process data audit in NeoFS system.
|
||||
Package audit provides features to process data audit in FrostFS system.
|
||||
|
||||
Result type groups values which can be gathered during data audit process:
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/TrueCloudLab/frostfs-sdk-go/version"
|
||||
)
|
||||
|
||||
// Result represents report on the results of the data audit in NeoFS system.
|
||||
// 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.
|
||||
|
@ -23,7 +23,7 @@ type Result struct {
|
|||
v2 audit.DataAuditResult
|
||||
}
|
||||
|
||||
// Marshal encodes Result into a canonical NeoFS binary format (Protocol Buffers
|
||||
// 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
|
||||
|
@ -43,7 +43,7 @@ func (r *Result) Marshal() []byte {
|
|||
|
||||
var errCIDNotSet = errors.New("container ID is not set")
|
||||
|
||||
// Unmarshal decodes Result from its canonical NeoFS binary format (Protocol Buffers
|
||||
// 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.
|
||||
|
@ -91,7 +91,7 @@ func (r *Result) Unmarshal(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Epoch returns NeoFS epoch when the data associated with the Result was audited.
|
||||
// Epoch returns FrostFS epoch when the data associated with the Result was audited.
|
||||
//
|
||||
// Zero Result has zero epoch.
|
||||
//
|
||||
|
@ -100,7 +100,7 @@ func (r Result) Epoch() uint64 {
|
|||
return r.v2.GetAuditEpoch()
|
||||
}
|
||||
|
||||
// ForEpoch specifies NeoFS epoch when the data associated with the Result was audited.
|
||||
// ForEpoch specifies FrostFS epoch when the data associated with the Result was audited.
|
||||
//
|
||||
// See also Epoch.
|
||||
func (r *Result) ForEpoch(epoch uint64) {
|
||||
|
@ -136,8 +136,8 @@ func (r *Result) ForContainer(cnr cid.ID) {
|
|||
r.v2.SetContainerID(&cidV2)
|
||||
}
|
||||
|
||||
// AuditorKey returns public key of the auditing NeoFS Inner Ring node in
|
||||
// a NeoFS binary key format.
|
||||
// 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.
|
||||
|
@ -147,8 +147,8 @@ func (r Result) AuditorKey() []byte {
|
|||
return r.v2.GetPublicKey()
|
||||
}
|
||||
|
||||
// SetAuditorKey specifies public key of the auditing NeoFS Inner Ring node in
|
||||
// a NeoFS binary key format.
|
||||
// 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.
|
||||
//
|
||||
|
|
|
@ -136,7 +136,7 @@ func (b Token) WriteToV2(m *acl.BearerToken) {
|
|||
}
|
||||
|
||||
// SetExp sets "exp" (expiration time) claim which identifies the
|
||||
// expiration time (in NeoFS epochs) after which the Token MUST NOT be
|
||||
// expiration time (in FrostFS epochs) after which the Token MUST NOT be
|
||||
// accepted for processing. The processing of the "exp" claim requires
|
||||
// that the current epoch MUST be before or equal to the expiration epoch
|
||||
// listed in the "exp" claim.
|
||||
|
@ -150,7 +150,7 @@ func (b *Token) SetExp(exp uint64) {
|
|||
}
|
||||
|
||||
// SetNbf sets "nbf" (not before) claim which identifies the time (in
|
||||
// NeoFS epochs) before which the Token MUST NOT be accepted for processing. The
|
||||
// FrostFS epochs) before which the Token MUST NOT be accepted for processing. The
|
||||
// processing of the "nbf" claim requires that the current epoch MUST be
|
||||
// after or equal to the not-before epoch listed in the "nbf" claim.
|
||||
//
|
||||
|
@ -162,7 +162,7 @@ func (b *Token) SetNbf(nbf uint64) {
|
|||
b.lifetimeSet = true
|
||||
}
|
||||
|
||||
// SetIat sets "iat" (issued at) claim which identifies the time (in NeoFS
|
||||
// SetIat sets "iat" (issued at) claim which identifies the time (in FrostFS
|
||||
// epochs) at which the Token was issued. This claim can be used to determine
|
||||
// the age of the Token.
|
||||
//
|
||||
|
@ -189,7 +189,7 @@ func (b Token) InvalidAt(epoch uint64) bool {
|
|||
// within any issuer's container.
|
||||
//
|
||||
// SetEACLTable MUST be called if Token is going to be transmitted over
|
||||
// NeoFS API V2 protocol.
|
||||
// FrostFS API V2 protocol.
|
||||
//
|
||||
// See also EACLTable, AssertContainer.
|
||||
func (b *Token) SetEACLTable(table eacl.Table) {
|
||||
|
@ -249,7 +249,7 @@ func (b Token) AssertUser(id user.ID) bool {
|
|||
// Returns signature calculation errors.
|
||||
//
|
||||
// Sign MUST be called if Token is going to be transmitted over
|
||||
// NeoFS API V2 protocol.
|
||||
// FrostFS API V2 protocol.
|
||||
//
|
||||
// Note that any Token mutation is likely to break the signature, so it is
|
||||
// expected to be calculated as a final stage of Token formation.
|
||||
|
@ -285,7 +285,7 @@ func (b Token) VerifySignature() bool {
|
|||
return sig.ReadFromV2(b.sig) == nil && sig.Verify(b.signedData())
|
||||
}
|
||||
|
||||
// Marshal encodes Token into a binary format of the NeoFS API protocol
|
||||
// Marshal encodes Token into a binary format of the FrostFS API protocol
|
||||
// (Protocol Buffers V3 with direct field order).
|
||||
//
|
||||
// See also Unmarshal.
|
||||
|
@ -296,7 +296,7 @@ func (b Token) Marshal() []byte {
|
|||
return m.StableMarshal(nil)
|
||||
}
|
||||
|
||||
// Unmarshal decodes NeoFS API protocol binary data into the Token
|
||||
// Unmarshal decodes FrostFS API protocol binary data into the Token
|
||||
// (Protocol Buffers V3 with direct field order). Returns an error describing
|
||||
// a format violation.
|
||||
//
|
||||
|
@ -312,7 +312,7 @@ func (b *Token) Unmarshal(data []byte) error {
|
|||
return b.readFromV2(m, false)
|
||||
}
|
||||
|
||||
// MarshalJSON encodes Token into a JSON format of the NeoFS API protocol
|
||||
// MarshalJSON encodes Token into a JSON format of the FrostFS API protocol
|
||||
// (Protocol Buffers V3 JSON).
|
||||
//
|
||||
// See also UnmarshalJSON.
|
||||
|
@ -323,7 +323,7 @@ func (b Token) MarshalJSON() ([]byte, error) {
|
|||
return m.MarshalJSON()
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes NeoFS API protocol JSON data into the Token
|
||||
// UnmarshalJSON decodes FrostFS API protocol JSON data into the Token
|
||||
// (Protocol Buffers V3 JSON). Returns an error describing a format violation.
|
||||
//
|
||||
// See also MarshalJSON.
|
||||
|
@ -339,7 +339,7 @@ func (b *Token) UnmarshalJSON(data []byte) error {
|
|||
}
|
||||
|
||||
// SigningKeyBytes returns issuer's public key in a binary format of
|
||||
// NeoFS API protocol.
|
||||
// FrostFS API protocol.
|
||||
//
|
||||
// Unsigned Token has empty key.
|
||||
//
|
||||
|
|
|
@ -38,7 +38,7 @@ const (
|
|||
)
|
||||
|
||||
// ReadFromV2 reads Checksum from the refs.Checksum message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (c *Checksum) ReadFromV2(m refs.Checksum) error {
|
||||
|
|
|
@ -19,7 +19,7 @@ type PrmBalanceGet struct {
|
|||
account user.ID
|
||||
}
|
||||
|
||||
// SetAccount sets identifier of the NeoFS account for which the balance is requested.
|
||||
// SetAccount sets identifier of the FrostFS account for which the balance is requested.
|
||||
// Required parameter.
|
||||
func (x *PrmBalanceGet) SetAccount(id user.ID) {
|
||||
x.account = id
|
||||
|
@ -33,17 +33,17 @@ type ResBalanceGet struct {
|
|||
amount accounting.Decimal
|
||||
}
|
||||
|
||||
// Amount returns current amount of funds on the NeoFS account as decimal number.
|
||||
// Amount returns current amount of funds on the FrostFS account as decimal number.
|
||||
func (x ResBalanceGet) Amount() accounting.Decimal {
|
||||
return x.amount
|
||||
}
|
||||
|
||||
// BalanceGet requests current balance of the NeoFS account.
|
||||
// BalanceGet requests current balance of the FrostFS account.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`,
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmBalanceGet docs).
|
||||
|
|
|
@ -9,13 +9,13 @@ import (
|
|||
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
||||
)
|
||||
|
||||
// interface of NeoFS API server. Exists for test purposes only.
|
||||
type neoFSAPIServer interface {
|
||||
// interface of FrostFS API server. Exists for test purposes only.
|
||||
type frostFSAPIServer interface {
|
||||
netMapSnapshot(context.Context, v2netmap.SnapshotRequest) (*v2netmap.SnapshotResponse, error)
|
||||
}
|
||||
|
||||
// wrapper over real client connection which communicates over NeoFS API protocol.
|
||||
// Provides neoFSAPIServer for Client instances used in real applications.
|
||||
// wrapper over real client connection which communicates over FrostFS API protocol.
|
||||
// Provides frostFSAPIServer for Client instances used in real applications.
|
||||
type coreServer client.Client
|
||||
|
||||
// unifies errors of all RPC.
|
||||
|
@ -23,7 +23,7 @@ func rpcErr(e error) error {
|
|||
return fmt.Errorf("rpc failure: %w", e)
|
||||
}
|
||||
|
||||
// executes NetmapService.NetmapSnapshot RPC declared in NeoFS API protocol
|
||||
// executes NetmapService.NetmapSnapshot RPC declared in FrostFS API protocol
|
||||
// using underlying client.Client.
|
||||
func (x *coreServer) netMapSnapshot(ctx context.Context, req v2netmap.SnapshotRequest) (*v2netmap.SnapshotResponse, error) {
|
||||
resp, err := rpcapi.NetMapSnapshot((*client.Client)(x), &req, client.WithContext(ctx))
|
||||
|
|
|
@ -12,14 +12,14 @@ import (
|
|||
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
||||
)
|
||||
|
||||
// Client represents virtual connection to the NeoFS network to communicate
|
||||
// with NeoFS server using NeoFS API protocol. It is designed to provide
|
||||
// Client represents virtual connection to the FrostFS network to communicate
|
||||
// with FrostFS server using FrostFS API protocol. It is designed to provide
|
||||
// an abstraction interface from the protocol details of data transfer over
|
||||
// a network in NeoFS.
|
||||
// a network in FrostFS.
|
||||
//
|
||||
// Client can be created using simple Go variable declaration. Before starting
|
||||
// work with the Client, it SHOULD BE correctly initialized (see Init method).
|
||||
// Before executing the NeoFS operations using the Client, connection to the
|
||||
// Before executing the FrostFS operations using the Client, connection to the
|
||||
// server MUST BE correctly established (see Dial method and pay attention
|
||||
// to the mandatory parameters). Using the Client before connecting have
|
||||
// been established can lead to a panic. After the work, the Client SHOULD BE
|
||||
|
@ -28,7 +28,7 @@ import (
|
|||
// during the communication process step strongly discouraged as it leads to
|
||||
// undefined behavior.
|
||||
//
|
||||
// Each method which produces a NeoFS API call may return a server response.
|
||||
// Each method which produces a FrostFS API call may return a server response.
|
||||
// Status responses are returned in the result structure, and can be cast
|
||||
// to built-in error instance (or in the returned error if the client is
|
||||
// configured accordingly). Certain statuses can be checked using `apistatus`
|
||||
|
@ -48,7 +48,7 @@ type Client struct {
|
|||
|
||||
c client.Client
|
||||
|
||||
server neoFSAPIServer
|
||||
server frostFSAPIServer
|
||||
}
|
||||
|
||||
// Init brings the Client instance to its initial state.
|
||||
|
@ -61,7 +61,7 @@ func (c *Client) Init(prm PrmInit) {
|
|||
c.prm = prm
|
||||
}
|
||||
|
||||
// Dial establishes a connection to the server from the NeoFS network.
|
||||
// Dial establishes a connection to the server from the FrostFS network.
|
||||
// Returns an error describing failure reason. If failed, the Client
|
||||
// SHOULD NOT be used.
|
||||
//
|
||||
|
@ -103,7 +103,7 @@ func (c *Client) Dial(prm PrmDial) error {
|
|||
client.WithRWTimeout(prm.streamTimeout),
|
||||
)...)
|
||||
|
||||
c.setNeoFSAPIServer((*coreServer)(&c.c))
|
||||
c.setFrostFSAPIServer((*coreServer)(&c.c))
|
||||
|
||||
if prm.parentCtx == nil {
|
||||
prm.parentCtx = context.Background()
|
||||
|
@ -121,15 +121,15 @@ func (c *Client) Dial(prm PrmDial) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// sets underlying provider of neoFSAPIServer. The method is used for testing as an approach
|
||||
// to skip Dial stage and override NeoFS API server. MUST NOT be used outside test code.
|
||||
// sets underlying provider of frostFSAPIServer. The method is used for testing as an approach
|
||||
// to skip Dial stage and override FrostFS API server. MUST NOT be used outside test code.
|
||||
// In real applications wrapper over github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client
|
||||
// is statically used.
|
||||
func (c *Client) setNeoFSAPIServer(server neoFSAPIServer) {
|
||||
func (c *Client) setFrostFSAPIServer(server frostFSAPIServer) {
|
||||
c.server = server
|
||||
}
|
||||
|
||||
// Close closes underlying connection to the NeoFS server. Implements io.Closer.
|
||||
// Close closes underlying connection to the FrostFS server. Implements io.Closer.
|
||||
// MUST NOT be called before successful Dial. Can be called concurrently
|
||||
// with server operations processing on running goroutines: in this case
|
||||
// they are likely to fail due to a connection error.
|
||||
|
@ -146,7 +146,7 @@ func (c *Client) Close() error {
|
|||
//
|
||||
// See also Init.
|
||||
type PrmInit struct {
|
||||
resolveNeoFSErrors bool
|
||||
resolveFrostFSErrors bool
|
||||
|
||||
key ecdsa.PrivateKey
|
||||
|
||||
|
@ -163,16 +163,16 @@ func (x *PrmInit) SetDefaultPrivateKey(key ecdsa.PrivateKey) {
|
|||
x.key = key
|
||||
}
|
||||
|
||||
// ResolveNeoFSFailures makes the Client to resolve failure statuses of the
|
||||
// NeoFS protocol into Go built-in errors. These errors are returned from
|
||||
// ResolveFrostFSFailures makes the Client to resolve failure statuses of the
|
||||
// FrostFS protocol into Go built-in errors. These errors are returned from
|
||||
// each protocol operation. By default, statuses aren't resolved and written
|
||||
// to the resulting structure (see corresponding Res* docs).
|
||||
func (x *PrmInit) ResolveNeoFSFailures() {
|
||||
x.resolveNeoFSErrors = true
|
||||
func (x *PrmInit) ResolveFrostFSFailures() {
|
||||
x.resolveFrostFSErrors = true
|
||||
}
|
||||
|
||||
// SetResponseInfoCallback makes the Client to pass ResponseMetaInfo from each
|
||||
// NeoFS server response to f. Nil (default) means ignore response meta info.
|
||||
// FrostFS server response to f. Nil (default) means ignore response meta info.
|
||||
func (x *PrmInit) SetResponseInfoCallback(f func(ResponseMetaInfo) error) {
|
||||
x.cbRespInfo = f
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ type PrmDial struct {
|
|||
parentCtx context.Context
|
||||
}
|
||||
|
||||
// SetServerURI sets server URI in the NeoFS network.
|
||||
// SetServerURI sets server URI in the FrostFS network.
|
||||
// Required parameter.
|
||||
//
|
||||
// Format of the URI:
|
||||
|
@ -212,7 +212,7 @@ func (x *PrmDial) SetServerURI(endpoint string) {
|
|||
}
|
||||
|
||||
// SetTLSConfig sets tls.Config to open TLS client connection
|
||||
// to the NeoFS server. Nil (default) means insecure connection.
|
||||
// to the FrostFS server. Nil (default) means insecure connection.
|
||||
//
|
||||
// See also SetServerURI.
|
||||
func (x *PrmDial) SetTLSConfig(tlsConfig *tls.Config) {
|
||||
|
|
|
@ -28,13 +28,13 @@ func assertStatusErr(tb testing.TB, res interface{ Status() apistatus.Status })
|
|||
require.Equal(tb, statusErr.Message(), res.Status().(*apistatus.ServerInternal).Message())
|
||||
}
|
||||
|
||||
func newClient(server neoFSAPIServer) *Client {
|
||||
func newClient(server frostFSAPIServer) *Client {
|
||||
var prm PrmInit
|
||||
prm.SetDefaultPrivateKey(*key)
|
||||
|
||||
var c Client
|
||||
c.Init(prm)
|
||||
c.setNeoFSAPIServer(server)
|
||||
c.setFrostFSAPIServer(server)
|
||||
|
||||
return &c
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ func (x statusRes) Status() apistatus.Status {
|
|||
|
||||
// groups meta parameters shared between all Client operations.
|
||||
type prmCommonMeta struct {
|
||||
// NeoFS request X-Headers
|
||||
// FrostFS request X-Headers
|
||||
xHeaders []string
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ type contextCall struct {
|
|||
// if set, protocol errors will be expanded into a final error
|
||||
resolveAPIFailures bool
|
||||
|
||||
// NeoFS network magic
|
||||
// FrostFS network magic
|
||||
netMagic uint64
|
||||
|
||||
// Meta parameters
|
||||
|
@ -256,7 +256,7 @@ func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) {
|
|||
}
|
||||
|
||||
st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus())
|
||||
if c.prm.resolveNeoFSErrors {
|
||||
if c.prm.resolveFrostFSErrors {
|
||||
return st, apistatus.ErrFromStatus(st)
|
||||
}
|
||||
return st, nil
|
||||
|
@ -329,14 +329,14 @@ func (x *contextCall) processCall() bool {
|
|||
// initializes static cross-call parameters inherited from client.
|
||||
func (c *Client) initCallContext(ctx *contextCall) {
|
||||
ctx.key = c.prm.key
|
||||
ctx.resolveAPIFailures = c.prm.resolveNeoFSErrors
|
||||
ctx.resolveAPIFailures = c.prm.resolveFrostFSErrors
|
||||
ctx.callbackResp = c.prm.cbRespInfo
|
||||
ctx.netMagic = c.prm.netMagic
|
||||
}
|
||||
|
||||
// ExecRaw executes f with underlying github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client.Client
|
||||
// instance. Communicate over the Protocol Buffers protocol in a more flexible way:
|
||||
// most often used to transmit data over a fixed version of the NeoFS protocol, as well
|
||||
// most often used to transmit data over a fixed version of the FrostFS protocol, as well
|
||||
// as to support custom services.
|
||||
//
|
||||
// The f must not manipulate the client connection passed into it.
|
||||
|
|
|
@ -30,7 +30,7 @@ type PrmContainerPut struct {
|
|||
session session.Container
|
||||
}
|
||||
|
||||
// SetContainer sets structured information about new NeoFS container.
|
||||
// SetContainer sets structured information about new FrostFS container.
|
||||
// Required parameter.
|
||||
func (x *PrmContainerPut) SetContainer(cnr container.Container) {
|
||||
x.cnr = cnr
|
||||
|
@ -64,12 +64,12 @@ func (x ResContainerPut) ID() cid.ID {
|
|||
return x.id
|
||||
}
|
||||
|
||||
// ContainerPut sends request to save container in NeoFS.
|
||||
// ContainerPut sends request to save container in FrostFS.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Operation is asynchronous and no guaranteed even in the absence of errors.
|
||||
|
@ -196,12 +196,12 @@ func (x ResContainerGet) Container() container.Container {
|
|||
return x.cnr
|
||||
}
|
||||
|
||||
// ContainerGet reads NeoFS container by ID.
|
||||
// ContainerGet reads FrostFS container by ID.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmContainerGet docs).
|
||||
|
@ -275,7 +275,7 @@ type PrmContainerList struct {
|
|||
ownerID user.ID
|
||||
}
|
||||
|
||||
// SetAccount sets identifier of the NeoFS account to list the containers.
|
||||
// SetAccount sets identifier of the FrostFS account to list the containers.
|
||||
// Required parameter.
|
||||
func (x *PrmContainerList) SetAccount(id user.ID) {
|
||||
x.ownerID = id
|
||||
|
@ -300,8 +300,8 @@ func (x ResContainerList) Containers() []cid.ID {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmContainerList docs).
|
||||
|
@ -377,7 +377,7 @@ type PrmContainerDelete struct {
|
|||
tok session.Container
|
||||
}
|
||||
|
||||
// SetContainer sets identifier of the NeoFS container to be removed.
|
||||
// SetContainer sets identifier of the FrostFS container to be removed.
|
||||
// Required parameter.
|
||||
func (x *PrmContainerDelete) SetContainer(id cid.ID) {
|
||||
x.id = id
|
||||
|
@ -400,12 +400,12 @@ type ResContainerDelete struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// ContainerDelete sends request to remove the NeoFS container.
|
||||
// ContainerDelete sends request to remove the FrostFS container.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Operation is asynchronous and no guaranteed even in the absence of errors.
|
||||
|
@ -501,7 +501,7 @@ type PrmContainerEACL struct {
|
|||
id cid.ID
|
||||
}
|
||||
|
||||
// SetContainer sets identifier of the NeoFS container to read the eACL table.
|
||||
// SetContainer sets identifier of the FrostFS container to read the eACL table.
|
||||
// Required parameter.
|
||||
func (x *PrmContainerEACL) SetContainer(id cid.ID) {
|
||||
x.id = id
|
||||
|
@ -520,12 +520,12 @@ func (x ResContainerEACL) Table() eacl.Table {
|
|||
return x.table
|
||||
}
|
||||
|
||||
// ContainerEACL reads eACL table of the NeoFS container.
|
||||
// ContainerEACL reads eACL table of the FrostFS container.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmContainerEACL docs).
|
||||
|
@ -629,12 +629,12 @@ type ResContainerSetEACL struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// ContainerSetEACL sends request to update eACL table of the NeoFS container.
|
||||
// ContainerSetEACL sends request to update eACL table of the FrostFS container.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Operation is asynchronous and no guaranteed even in the absence of errors.
|
||||
|
@ -738,8 +738,8 @@ type ResAnnounceSpace struct {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Operation is asynchronous and no guaranteed even in the absence of errors.
|
||||
|
@ -761,13 +761,13 @@ func (c *Client) ContainerAnnounceUsedSpace(ctx context.Context, prm PrmAnnounce
|
|||
panic("missing announcements")
|
||||
}
|
||||
|
||||
// convert list of SDK announcement structures into NeoFS-API v2 list
|
||||
// convert list of SDK announcement structures into FrostFS-API v2 list
|
||||
v2announce := make([]v2container.UsedSpaceAnnouncement, len(prm.announcements))
|
||||
for i := range prm.announcements {
|
||||
prm.announcements[i].WriteToV2(&v2announce[i])
|
||||
}
|
||||
|
||||
// prepare body of the NeoFS-API v2 request and request itself
|
||||
// prepare body of the FrostFS-API v2 request and request itself
|
||||
reqBody := new(v2container.AnnounceUsedSpaceRequestBody)
|
||||
reqBody.SetAnnouncements(v2announce)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package client provides NeoFS API client implementation.
|
||||
Package client provides FrostFS API client implementation.
|
||||
|
||||
The main component is Client type. It is a virtual connection to the network
|
||||
and provides methods for executing operations on the server.
|
||||
|
@ -16,7 +16,7 @@ Initialize client state:
|
|||
|
||||
c.Init(prm)
|
||||
|
||||
Connect to the NeoFS server:
|
||||
Connect to the FrostFS server:
|
||||
|
||||
var prm client.PrmDial
|
||||
prm.SetServerURI("localhost:8080")
|
||||
|
@ -26,7 +26,7 @@ Connect to the NeoFS server:
|
|||
err := c.Dial(prm)
|
||||
// ...
|
||||
|
||||
Execute NeoFS operation on the server:
|
||||
Execute FrostFS operation on the server:
|
||||
|
||||
var prm client.PrmContainerPut
|
||||
prm.SetContainer(cnr)
|
||||
|
@ -74,7 +74,7 @@ with an interface:
|
|||
|
||||
import "github.com/TrueCloudLab/frostfs-sdk-go/client"
|
||||
|
||||
type NeoFSClient interface {
|
||||
type FrostFSClient interface {
|
||||
// Operations according to the application needs
|
||||
CreateContainer(context.Context, container.Container) error
|
||||
// ...
|
||||
|
|
|
@ -16,7 +16,7 @@ func unwrapErr(err error) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// IsErrContainerNotFound checks if err corresponds to NeoFS status
|
||||
// IsErrContainerNotFound checks if err corresponds to FrostFS status
|
||||
// return corresponding to missing container. Supports wrapped errors.
|
||||
func IsErrContainerNotFound(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -29,7 +29,7 @@ func IsErrContainerNotFound(err error) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// IsErrEACLNotFound checks if err corresponds to NeoFS status
|
||||
// IsErrEACLNotFound checks if err corresponds to FrostFS status
|
||||
// return corresponding to missing eACL table. Supports wrapped errors.
|
||||
func IsErrEACLNotFound(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -42,7 +42,7 @@ func IsErrEACLNotFound(err error) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// IsErrObjectNotFound checks if err corresponds to NeoFS status
|
||||
// IsErrObjectNotFound checks if err corresponds to FrostFS status
|
||||
// return corresponding to missing object. Supports wrapped errors.
|
||||
func IsErrObjectNotFound(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -55,7 +55,7 @@ func IsErrObjectNotFound(err error) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// IsErrObjectAlreadyRemoved checks if err corresponds to NeoFS status
|
||||
// IsErrObjectAlreadyRemoved checks if err corresponds to FrostFS status
|
||||
// return corresponding to already removed object. Supports wrapped errors.
|
||||
func IsErrObjectAlreadyRemoved(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -68,7 +68,7 @@ func IsErrObjectAlreadyRemoved(err error) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// IsErrSessionExpired checks if err corresponds to NeoFS status return
|
||||
// IsErrSessionExpired checks if err corresponds to FrostFS status return
|
||||
// corresponding to expired session. Supports wrapped errors.
|
||||
func IsErrSessionExpired(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -81,7 +81,7 @@ func IsErrSessionExpired(err error) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// IsErrSessionNotFound checks if err corresponds to NeoFS status return
|
||||
// IsErrSessionNotFound checks if err corresponds to FrostFS status return
|
||||
// corresponding to missing session. Supports wrapped errors.
|
||||
func IsErrSessionNotFound(err error) bool {
|
||||
switch unwrapErr(err).(type) {
|
||||
|
@ -99,7 +99,7 @@ func newErrMissingResponseField(name string) error {
|
|||
return fmt.Errorf("missing %s field in the response", name)
|
||||
}
|
||||
|
||||
// returns error describing invalid field (according to the NeoFS protocol)
|
||||
// returns error describing invalid field (according to the FrostFS protocol)
|
||||
// with the given name and format violation err.
|
||||
func newErrInvalidResponseField(name string, err error) error {
|
||||
return fmt.Errorf("invalid %s field in the response: %w", name, err)
|
||||
|
|
|
@ -28,12 +28,12 @@ type ResEndpointInfo struct {
|
|||
ni netmap.NodeInfo
|
||||
}
|
||||
|
||||
// LatestVersion returns latest NeoFS API protocol's version in use.
|
||||
// LatestVersion returns latest FrostFS API protocol's version in use.
|
||||
func (x ResEndpointInfo) LatestVersion() version.Version {
|
||||
return x.version
|
||||
}
|
||||
|
||||
// NodeInfo returns information about the NeoFS node served on the remote endpoint.
|
||||
// NodeInfo returns information about the FrostFS node served on the remote endpoint.
|
||||
func (x ResEndpointInfo) NodeInfo() netmap.NodeInfo {
|
||||
return x.ni
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ func (x ResEndpointInfo) NodeInfo() netmap.NodeInfo {
|
|||
// Method can be used as a health check to see if node is alive and responds to requests.
|
||||
//
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmEndpointInfo docs).
|
||||
|
@ -132,16 +132,16 @@ type ResNetworkInfo struct {
|
|||
info netmap.NetworkInfo
|
||||
}
|
||||
|
||||
// Info returns structured information about the NeoFS network.
|
||||
// Info returns structured information about the FrostFS network.
|
||||
func (x ResNetworkInfo) Info() netmap.NetworkInfo {
|
||||
return x.info
|
||||
}
|
||||
|
||||
// NetworkInfo requests information about the NeoFS network of which the remote server is a part.
|
||||
// NetworkInfo requests information about the FrostFS network of which the remote server is a part.
|
||||
//
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmNetworkInfo docs).
|
||||
|
@ -220,8 +220,8 @@ func (x ResNetMapSnapshot) NetMap() netmap.NetMap {
|
|||
// NetMapSnapshot requests current network view of the remote server.
|
||||
//
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Context is required and MUST NOT be nil. It is used for network communication.
|
||||
|
|
|
@ -55,7 +55,7 @@ func (x *PrmObjectDelete) WithBearerToken(t bearer.Token) {
|
|||
x.meta.SetBearerToken(&v2token)
|
||||
}
|
||||
|
||||
// FromContainer specifies NeoFS container of the object.
|
||||
// FromContainer specifies FrostFS container of the object.
|
||||
// Required parameter.
|
||||
func (x *PrmObjectDelete) FromContainer(id cid.ID) {
|
||||
var cidV2 v2refs.ContainerID
|
||||
|
@ -100,7 +100,7 @@ func (x ResObjectDelete) Tombstone() oid.ID {
|
|||
return x.tomb
|
||||
}
|
||||
|
||||
// ObjectDelete marks an object for deletion from the container using NeoFS API protocol.
|
||||
// ObjectDelete marks an object for deletion from the container using FrostFS API protocol.
|
||||
// As a marker, a special unit called a tombstone is placed in the container.
|
||||
// It confirms the user's intent to delete the object, and is itself a container object.
|
||||
// Explicit deletion is done asynchronously, and is generally not guaranteed.
|
||||
|
@ -110,8 +110,8 @@ func (x ResObjectDelete) Tombstone() oid.ID {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`,
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmObjectDelete docs).
|
||||
|
|
|
@ -72,7 +72,7 @@ func (x *prmObjectRead) WithBearerToken(t bearer.Token) {
|
|||
x.meta.SetBearerToken(&v2token)
|
||||
}
|
||||
|
||||
// FromContainer specifies NeoFS container of the object.
|
||||
// FromContainer specifies FrostFS container of the object.
|
||||
// Required parameter.
|
||||
func (x *prmObjectRead) FromContainer(id cid.ID) {
|
||||
var cnrV2 v2refs.ContainerID
|
||||
|
@ -100,7 +100,7 @@ type ResObjectGet struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// ObjectReader is designed to read one object from NeoFS system.
|
||||
// ObjectReader is designed to read one object from FrostFS system.
|
||||
//
|
||||
// Must be initialized using Client.ObjectGetInit, any other
|
||||
// usage is unsafe.
|
||||
|
@ -251,7 +251,7 @@ func (x *ObjectReader) close(ignoreEOF bool) (*ResObjectGet, error) {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as Go built-in error.
|
||||
// If Client is tuned to resolve NeoFS API statuses, then NeoFS failures
|
||||
// If Client is tuned to resolve FrostFS API statuses, then FrostFS failures
|
||||
// codes are returned as error.
|
||||
//
|
||||
// Return errors:
|
||||
|
@ -291,7 +291,7 @@ func (x *ObjectReader) Read(p []byte) (int, error) {
|
|||
return n, nil
|
||||
}
|
||||
|
||||
// ObjectGetInit initiates reading an object through a remote server using NeoFS API protocol.
|
||||
// ObjectGetInit initiates reading an object through a remote server using FrostFS API protocol.
|
||||
//
|
||||
// The call only opens the transmission channel, explicit fetching is done using the ObjectReader.
|
||||
// Exactly one return value is non-nil. Resulting reader must be finally closed.
|
||||
|
@ -392,12 +392,12 @@ func (x *ResObjectHead) ReadHeader(dst *object.Object) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// ObjectHead reads object header through a remote server using NeoFS API protocol.
|
||||
// ObjectHead reads object header through a remote server using FrostFS API protocol.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`,
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmObjectHead docs).
|
||||
|
@ -505,7 +505,7 @@ type ResObjectRange struct {
|
|||
}
|
||||
|
||||
// ObjectRangeReader is designed to read payload range of one object
|
||||
// from NeoFS system.
|
||||
// from FrostFS system.
|
||||
//
|
||||
// Must be initialized using Client.ObjectRangeInit, any other
|
||||
// usage is unsafe.
|
||||
|
@ -616,7 +616,7 @@ func (x *ObjectRangeReader) close(ignoreEOF bool) (*ResObjectRange, error) {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as Go built-in error.
|
||||
// If Client is tuned to resolve NeoFS API statuses, then NeoFS failures
|
||||
// If Client is tuned to resolve FrostFS API statuses, then FrostFS failures
|
||||
// codes are returned as error.
|
||||
//
|
||||
// Return errors:
|
||||
|
@ -658,7 +658,7 @@ func (x *ObjectRangeReader) Read(p []byte) (int, error) {
|
|||
}
|
||||
|
||||
// ObjectRangeInit initiates reading an object's payload range through a remote
|
||||
// server using NeoFS API protocol.
|
||||
// server using FrostFS API protocol.
|
||||
//
|
||||
// The call only opens the transmission channel, explicit fetching is done using the ObjectRangeReader.
|
||||
// Exactly one return value is non-nil. Resulting reader must be finally closed.
|
||||
|
|
|
@ -69,7 +69,7 @@ func (x *PrmObjectHash) WithBearerToken(t bearer.Token) {
|
|||
x.meta.SetBearerToken(&v2token)
|
||||
}
|
||||
|
||||
// FromContainer specifies NeoFS container of the object.
|
||||
// FromContainer specifies FrostFS container of the object.
|
||||
// Required parameter.
|
||||
func (x *PrmObjectHash) FromContainer(id cid.ID) {
|
||||
var cidV2 v2refs.ContainerID
|
||||
|
@ -143,15 +143,15 @@ func (x ResObjectHash) Checksums() [][]byte {
|
|||
}
|
||||
|
||||
// ObjectHash requests checksum of the range list of the object payload using
|
||||
// NeoFS API protocol.
|
||||
// FrostFS API protocol.
|
||||
//
|
||||
// Returns a list of checksums in raw form: the format of hashes and their number
|
||||
// is left for the caller to check. Client preserves the order of the server's response.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`,
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmObjectHash docs).
|
||||
|
|
|
@ -44,7 +44,7 @@ func (x ResObjectPut) StoredObjectID() oid.ID {
|
|||
return x.obj
|
||||
}
|
||||
|
||||
// ObjectWriter is designed to write one object to NeoFS system.
|
||||
// ObjectWriter is designed to write one object to FrostFS system.
|
||||
//
|
||||
// Must be initialized using Client.ObjectPutInit, any other
|
||||
// usage is unsafe.
|
||||
|
@ -181,7 +181,7 @@ func (x *ObjectWriter) WritePayloadChunk(chunk []byte) bool {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as Go built-in error.
|
||||
// If Client is tuned to resolve NeoFS API statuses, then NeoFS failures
|
||||
// If Client is tuned to resolve FrostFS API statuses, then FrostFS failures
|
||||
// codes are returned as error.
|
||||
//
|
||||
// Return statuses:
|
||||
|
@ -230,7 +230,7 @@ func (x *ObjectWriter) Close() (*ResObjectPut, error) {
|
|||
return &x.res, nil
|
||||
}
|
||||
|
||||
// ObjectPutInit initiates writing an object through a remote server using NeoFS API protocol.
|
||||
// ObjectPutInit initiates writing an object through a remote server using FrostFS API protocol.
|
||||
//
|
||||
// The call only opens the transmission channel, explicit recording is done using the ObjectWriter.
|
||||
// Exactly one return value is non-nil. Resulting writer must be finally closed.
|
||||
|
|
|
@ -94,7 +94,7 @@ type ResObjectSearch struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// ObjectListReader is designed to read list of object identifiers from NeoFS system.
|
||||
// ObjectListReader is designed to read list of object identifiers from FrostFS system.
|
||||
//
|
||||
// Must be initialized using Client.ObjectSearch, any other usage is unsafe.
|
||||
type ObjectListReader struct {
|
||||
|
@ -194,7 +194,7 @@ func (x *ObjectListReader) Iterate(f func(oid.ID) bool) error {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as Go built-in error.
|
||||
// If Client is tuned to resolve NeoFS API statuses, then NeoFS failures
|
||||
// If Client is tuned to resolve FrostFS API statuses, then FrostFS failures
|
||||
// codes are returned as error.
|
||||
//
|
||||
// Return statuses:
|
||||
|
@ -212,7 +212,7 @@ func (x *ObjectListReader) Close() (*ResObjectSearch, error) {
|
|||
return &x.res, nil
|
||||
}
|
||||
|
||||
// ObjectSearchInit initiates object selection through a remote server using NeoFS API protocol.
|
||||
// ObjectSearchInit initiates object selection through a remote server using FrostFS API protocol.
|
||||
//
|
||||
// The call only opens the transmission channel, explicit fetching of matched objects
|
||||
// is done using the ObjectListReader. Exactly one return value is non-nil.
|
||||
|
|
|
@ -18,13 +18,13 @@ type PrmAnnounceLocalTrust struct {
|
|||
trusts []reputation.Trust
|
||||
}
|
||||
|
||||
// SetEpoch sets number of NeoFS epoch in which the trust was assessed.
|
||||
// SetEpoch sets number of FrostFS epoch in which the trust was assessed.
|
||||
// Required parameter, must not be zero.
|
||||
func (x *PrmAnnounceLocalTrust) SetEpoch(epoch uint64) {
|
||||
x.epoch = epoch
|
||||
}
|
||||
|
||||
// SetValues sets values describing trust of the client to the NeoFS network participants.
|
||||
// SetValues sets values describing trust of the client to the FrostFS network participants.
|
||||
// Required parameter. Must not be empty.
|
||||
//
|
||||
// Must not be mutated before the end of the operation.
|
||||
|
@ -37,12 +37,12 @@ type ResAnnounceLocalTrust struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// AnnounceLocalTrust sends client's trust values to the NeoFS network participants.
|
||||
// AnnounceLocalTrust sends client's trust values to the FrostFS network participants.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmAnnounceLocalTrust docs).
|
||||
|
@ -113,7 +113,7 @@ type PrmAnnounceIntermediateTrust struct {
|
|||
trust reputation.PeerToPeerTrust
|
||||
}
|
||||
|
||||
// SetEpoch sets number of NeoFS epoch with which client's calculation algorithm is initialized.
|
||||
// SetEpoch sets number of FrostFS epoch with which client's calculation algorithm is initialized.
|
||||
// Required parameter, must not be zero.
|
||||
func (x *PrmAnnounceIntermediateTrust) SetEpoch(epoch uint64) {
|
||||
x.epoch = epoch
|
||||
|
@ -137,13 +137,13 @@ type ResAnnounceIntermediateTrust struct {
|
|||
statusRes
|
||||
}
|
||||
|
||||
// AnnounceIntermediateTrust sends global trust values calculated for the specified NeoFS network participants
|
||||
// AnnounceIntermediateTrust sends global trust values calculated for the specified FrostFS network participants
|
||||
// at some stage of client's calculation algorithm.
|
||||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmAnnounceIntermediateTrust docs).
|
||||
|
|
|
@ -2,7 +2,7 @@ package client
|
|||
|
||||
import "github.com/TrueCloudLab/frostfs-api-go/v2/session"
|
||||
|
||||
// ResponseMetaInfo groups meta information about any NeoFS API response.
|
||||
// ResponseMetaInfo groups meta information about any FrostFS API response.
|
||||
type ResponseMetaInfo struct {
|
||||
key []byte
|
||||
|
||||
|
@ -21,7 +21,7 @@ func (x ResponseMetaInfo) ResponderKey() []byte {
|
|||
return x.key
|
||||
}
|
||||
|
||||
// Epoch returns local NeoFS epoch of the server.
|
||||
// Epoch returns local FrostFS epoch of the server.
|
||||
func (x ResponseMetaInfo) Epoch() uint64 {
|
||||
return x.epoch
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ func (x *ResSessionCreate) setID(id []byte) {
|
|||
x.id = id
|
||||
}
|
||||
|
||||
// ID returns identifier of the opened session in a binary NeoFS API protocol format.
|
||||
// ID returns identifier of the opened session in a binary FrostFS API protocol format.
|
||||
//
|
||||
// Client doesn't retain value so modification is safe.
|
||||
func (x ResSessionCreate) ID() []byte {
|
||||
|
@ -57,7 +57,7 @@ func (x *ResSessionCreate) setSessionKey(key []byte) {
|
|||
x.sessionKey = key
|
||||
}
|
||||
|
||||
// PublicKey returns public key of the opened session in a binary NeoFS API protocol format.
|
||||
// PublicKey returns public key of the opened session in a binary FrostFS API protocol format.
|
||||
func (x ResSessionCreate) PublicKey() []byte {
|
||||
return x.sessionKey
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ func (x ResSessionCreate) PublicKey() []byte {
|
|||
//
|
||||
// Exactly one return value is non-nil. By default, server status is returned in res structure.
|
||||
// Any client's internal or transport errors are returned as `error`.
|
||||
// If PrmInit.ResolveNeoFSFailures has been called, unsuccessful
|
||||
// NeoFS status codes are returned as `error`, otherwise, are included
|
||||
// If PrmInit.ResolveFrostFSFailures has been called, unsuccessful
|
||||
// FrostFS status codes are returned as `error`, otherwise, are included
|
||||
// in the returned result structure.
|
||||
//
|
||||
// Immediately panics if parameters are set incorrectly (see PrmSessionCreate docs).
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package apistatus
|
||||
|
||||
// Status defines a variety of NeoFS API status returns.
|
||||
// Status defines a variety of FrostFS API status returns.
|
||||
//
|
||||
// All statuses are split into two disjoint subsets: successful and failed, and:
|
||||
// - statuses that implement the build-in error interface are considered failed statuses;
|
||||
|
@ -14,7 +14,7 @@ package apistatus
|
|||
// IsSuccessful function should be used (try to avoid nil comparison).
|
||||
// It should be noted that using direct typecasting is not a compatible approach.
|
||||
//
|
||||
// To transport statuses using the NeoFS API V2 protocol, see StatusV2 interface and FromStatusV2 and ToStatusV2 functions.
|
||||
// To transport statuses using the FrostFS API V2 protocol, see StatusV2 interface and FromStatusV2 and ToStatusV2 functions.
|
||||
type Status interface{}
|
||||
|
||||
// ErrFromStatus converts Status instance to error if it is failed. Returns nil on successful Status.
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/TrueCloudLab/frostfs-api-go/v2/status"
|
||||
)
|
||||
|
||||
// StatusV2 defines a variety of Status instances compatible with NeoFS API V2 protocol.
|
||||
// StatusV2 defines a variety of Status instances compatible with FrostFS API V2 protocol.
|
||||
//
|
||||
// Note: it is not recommended to use this type directly, it is intended for documentation of the library functionality.
|
||||
type StatusV2 interface {
|
||||
|
|
|
@ -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 contro |