2021-05-26 10:30:08 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2021-11-10 07:08:33 +00:00
|
|
|
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/session"
|
2021-05-26 10:30:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// RemovalWitness groups the information required
|
|
|
|
// to prove and verify the removal of a container.
|
|
|
|
type RemovalWitness struct {
|
|
|
|
cid *cid.ID
|
|
|
|
|
|
|
|
sig []byte
|
2021-05-26 10:40:03 +00:00
|
|
|
|
|
|
|
token *session.Token
|
2021-05-26 10:30:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
2021-05-26 10:40:03 +00:00
|
|
|
|
|
|
|
// SessionToken returns token of the session within
|
|
|
|
// which container was removed.
|
|
|
|
func (x RemovalWitness) SessionToken() *session.Token {
|
|
|
|
return x.token
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetSessionToken sets token of the session within
|
|
|
|
// which container was removed.
|
|
|
|
func (x *RemovalWitness) SetSessionToken(tok *session.Token) {
|
|
|
|
x.token = tok
|
|
|
|
}
|