[#525] core/container: Define removal witness
Define `RemovalWitness` structure which groups the information required to prove and verify the removal of a container. This type is going to be used in container Delete-related methods. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
edfdc4274a
commit
d691a20d52
1 changed files with 35 additions and 0 deletions
35
pkg/core/container/delete.go
Normal file
35
pkg/core/container/delete.go
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
package container
|
||||||
|
|
||||||
|
import (
|
||||||
|
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RemovalWitness groups the information required
|
||||||
|
// to prove and verify the removal of a container.
|
||||||
|
type RemovalWitness struct {
|
||||||
|
cid *cid.ID
|
||||||
|
|
||||||
|
sig []byte
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContainerID returns identifier of the container
|
||||||
|
// to be removed.
|
||||||
|
func (x RemovalWitness) ContainerID() *cid.ID {
|
||||||
|
return x.cid
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContainerID sets identifier of the container
|
||||||
|
// to be removed.
|
||||||
|
func (x *RemovalWitness) SetContainerID(id *cid.ID) {
|
||||||
|
x.cid = id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Signature returns signature of the container identifier.
|
||||||
|
func (x RemovalWitness) Signature() []byte {
|
||||||
|
return x.sig
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetSignature sets signature of the container identifier.
|
||||||
|
func (x *RemovalWitness) SetSignature(sig []byte) {
|
||||||
|
x.sig = sig
|
||||||
|
}
|
Loading…
Reference in a new issue