frostfs-node/pkg/morph/client/netmap/add_peer.go

26 lines
531 B
Go
Raw Normal View History

2020-07-24 13:54:03 +00:00
package netmap
import (
"fmt"
2020-07-24 13:54:03 +00:00
)
// AddPeerArgs groups the arguments
// of add peer invocation call.
type AddPeerArgs struct {
info []byte
2020-07-24 13:54:03 +00:00
}
// SetInfo sets the peer information.
func (a *AddPeerArgs) SetInfo(v []byte) {
2020-07-24 13:54:03 +00:00
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
2020-07-24 13:54:03 +00:00
}