frostfs-node/pkg/morph/client/container/delete.go

44 lines
839 B
Go
Raw Normal View History

2020-07-24 13:54:03 +00:00
package container
import (
"fmt"
)
2020-07-24 13:54:03 +00:00
// DeleteArgs groups the arguments
// of delete container invocation call.
type DeleteArgs struct {
cid []byte // container identifier
sig []byte // container identifier signature
token []byte // binary session token
2020-07-24 13:54:03 +00:00
}
// 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 {
err := c.client.Invoke(
2020-07-24 13:54:03 +00:00
c.deleteMethod,
args.cid,
args.sig,
args.token,
)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.deleteMethod, err)
}
return nil
2020-07-24 13:54:03 +00:00
}