forked from TrueCloudLab/frostfs-node
Add Inner Ring code
This commit is contained in:
parent
dadfd90dcd
commit
b7b5079934
400 changed files with 11420 additions and 8690 deletions
44
pkg/morph/client/container/put.go
Normal file
44
pkg/morph/client/container/put.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// PutArgs groups the arguments
|
||||
// of put container invocation call.
|
||||
type PutArgs struct {
|
||||
ownerID []byte // container owner identifier
|
||||
|
||||
cnr []byte // container in a binary format
|
||||
|
||||
sig []byte // binary container signature
|
||||
}
|
||||
|
||||
// SetOwnerID sets the container owner identifier
|
||||
// in a binary format.
|
||||
func (p *PutArgs) SetOwnerID(v []byte) {
|
||||
p.ownerID = v
|
||||
}
|
||||
|
||||
// SetContainer sets the container structure
|
||||
// in a binary format.
|
||||
func (p *PutArgs) SetContainer(v []byte) {
|
||||
p.cnr = v
|
||||
}
|
||||
|
||||
// SetSignature sets the container structure
|
||||
// owner's signature.
|
||||
func (p *PutArgs) SetSignature(v []byte) {
|
||||
p.sig = v
|
||||
}
|
||||
|
||||
// Put invokes the call of put container method
|
||||
// of NeoFS Container contract.
|
||||
func (c *Client) Put(args PutArgs) error {
|
||||
return errors.Wrapf(c.client.Invoke(
|
||||
c.putMethod,
|
||||
args.ownerID,
|
||||
args.cnr,
|
||||
args.sig,
|
||||
), "could not invoke method (%s)", c.putMethod)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue