frostfs-node/pkg/morph/client/container/delete.go
Alex Vanin da92f2944f [#7] Fix container service according to APIv2 contracts
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-02 11:25:35 +03:00

33 lines
751 B
Go

package container
import "github.com/pkg/errors"
// DeleteArgs groups the arguments
// of delete container invocation call.
type DeleteArgs struct {
cid []byte // container identifier
sig []byte // container identifier signature
}
// SetCID sets the container identifier
// in a binary format.
func (p *DeleteArgs) SetCID(v []byte) {
p.cid = v
}
// SetSignature sets the container identifier
// owner's signature.
func (p *DeleteArgs) SetSignature(v []byte) {
p.sig = v
}
// Delete invokes the call of delete container
// method of NeoFS Container contract.
func (c *Client) Delete(args DeleteArgs) error {
return errors.Wrapf(c.client.Invoke(
c.deleteMethod,
args.cid,
args.sig,
), "could not invoke method (%s)", c.deleteMethod)
}