[#971] morph/netmap: Add optional parameters

Add optional parameters to the client call
signature. Group parameters of a client call
into struct to improve future codebase
support.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-10 13:44:19 +03:00 committed by Alex Vanin
parent 3114be39d0
commit c25f5a86ae
11 changed files with 224 additions and 90 deletions

View file

@ -10,6 +10,8 @@ import (
// of add peer invocation call.
type AddPeerArgs struct {
info []byte
client.InvokePrmOptional
}
// SetInfo sets the peer information.
@ -24,6 +26,7 @@ func (c *Client) AddPeer(args AddPeerArgs) error {
prm.SetMethod(c.addPeerMethod)
prm.SetArgs(args.info)
prm.InvokePrmOptional = args.InvokePrmOptional
if err := c.client.Invoke(prm); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.addPeerMethod, err)