forked from TrueCloudLab/frostfs-node
[#1087] *: Adopt SDK changes
- Update `neofs-sdk-go`: v0.0.0-20211230072947-1fe37df88f80 => v0.0.0-20220113123743-7f3162110659 - Add client interface that duplicates SDK's client behaviour and new `MultiAddressClient` interface that has method that iterates over wrapped clients. - Also start using simple client mode that does not require parsing statuses outside the SDK library. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
58d90eec7d
commit
7c02a2e251
32 changed files with 151 additions and 180 deletions
|
@ -289,7 +289,7 @@ func getEndpointAddress(endpointFlag string) (addr network.Address, err error) {
|
|||
}
|
||||
|
||||
type clientWithKey interface {
|
||||
SetClient(client.Client)
|
||||
SetClient(*client.Client)
|
||||
SetKey(*ecdsa.PrivateKey)
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ func prepareBearerPrm(cmd *cobra.Command, prm bearerPrm) {
|
|||
|
||||
// getSDKClient returns default neofs-api-go sdk client. Consider using
|
||||
// opts... to provide TTL or other global configuration flags.
|
||||
func getSDKClient(key *ecdsa.PrivateKey) (client.Client, error) {
|
||||
func getSDKClient(key *ecdsa.PrivateKey) (*client.Client, error) {
|
||||
netAddr, err := getEndpointAddress(rpc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -334,6 +334,7 @@ func getSDKClient(key *ecdsa.PrivateKey) (client.Client, error) {
|
|||
options := []client.Option{
|
||||
client.WithAddress(netAddr.HostAddr()),
|
||||
client.WithDefaultPrivateKey(key),
|
||||
client.WithNeoFSErrorParsing(),
|
||||
}
|
||||
|
||||
if netAddr.TLSEnabled() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue