frostfs-node/pkg/morph/client/netmap/add_peer.go
Evgenii Stratonikov 71b87155ef [#521] *: use stdlib errors package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-19 16:42:54 +03:00

25 lines
531 B
Go

package netmap
import (
"fmt"
)
// AddPeerArgs groups the arguments
// of add peer invocation call.
type AddPeerArgs struct {
info []byte
}
// SetInfo sets the peer information.
func (a *AddPeerArgs) SetInfo(v []byte) {
a.info = v
}
// AddPeer invokes the call of add peer method
// of NeoFS Netmap contract.
func (c *Client) AddPeer(args AddPeerArgs) error {
if err := c.client.Invoke(c.addPeerMethod, args.info); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.addPeerMethod, err)
}
return nil
}