2020-09-21 10:07:12 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
|
|
|
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
|
|
|
frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
|
2023-11-14 11:21:58 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
2020-09-21 10:07:12 +00:00
|
|
|
)
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// Container groups information about the FrostFS container stored in the FrostFS network.
|
2022-06-22 10:55:31 +00:00
|
|
|
type Container struct {
|
|
|
|
// Container structure.
|
2022-06-28 07:01:05 +00:00
|
|
|
Value container.Container
|
2022-06-22 10:55:31 +00:00
|
|
|
|
|
|
|
// Signature of the Value.
|
2022-12-23 17:35:35 +00:00
|
|
|
Signature frostfscrypto.Signature
|
2022-06-22 10:55:31 +00:00
|
|
|
|
|
|
|
// Session within which Value was created. Nil means session absence.
|
|
|
|
Session *session.Container
|
|
|
|
}
|
|
|
|
|
2023-08-18 14:12:24 +00:00
|
|
|
// DelInfo contains info about removed container.
|
|
|
|
type DelInfo struct {
|
|
|
|
// Container owner.
|
2023-11-14 11:21:58 +00:00
|
|
|
Owner user.ID
|
2023-08-18 14:12:24 +00:00
|
|
|
|
|
|
|
// Epoch indicates when the container was removed.
|
2023-11-14 11:47:31 +00:00
|
|
|
Epoch uint64
|
2023-08-18 14:12:24 +00:00
|
|
|
}
|
|
|
|
|
2020-09-21 10:07:12 +00:00
|
|
|
// Source is an interface that wraps
|
|
|
|
// basic container receiving method.
|
|
|
|
type Source interface {
|
2022-04-21 11:28:05 +00:00
|
|
|
// Get reads the container from the storage by its identifier.
|
|
|
|
// It returns the pointer to the requested container and any error encountered.
|
2020-09-21 10:07:12 +00:00
|
|
|
//
|
|
|
|
// Get must return exactly one non-nil value.
|
2022-04-21 11:28:05 +00:00
|
|
|
// Get must return an error of type apistatus.ContainerNotFound if the container is not in the storage.
|
2020-09-21 10:07:12 +00:00
|
|
|
//
|
|
|
|
// Implementations must not retain the container pointer and modify
|
|
|
|
// the container through it.
|
2022-06-22 10:55:31 +00:00
|
|
|
Get(cid.ID) (*Container, error)
|
2023-08-24 12:27:24 +00:00
|
|
|
|
|
|
|
DeletionInfo(cid.ID) (*DelInfo, error)
|
2020-09-21 10:07:12 +00:00
|
|
|
}
|
|
|
|
|
2023-02-05 15:59:38 +00:00
|
|
|
// EACL groups information about the FrostFS container's extended ACL stored in
|
|
|
|
// the FrostFS network.
|
2022-06-22 10:55:31 +00:00
|
|
|
type EACL struct {
|
|
|
|
// Extended ACL structure.
|
|
|
|
Value *eacl.Table
|
|
|
|
|
|
|
|
// Signature of the Value.
|
2022-12-23 17:35:35 +00:00
|
|
|
Signature frostfscrypto.Signature
|
2022-06-22 10:55:31 +00:00
|
|
|
|
|
|
|
// Session within which Value was set. Nil means session absence.
|
|
|
|
Session *session.Container
|
|
|
|
}
|