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"
|
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.
|
|
|
|
Owner []byte
|
|
|
|
|
|
|
|
// Epoch indicates when the container was removed.
|
|
|
|
Epoch int
|
|
|
|
}
|
|
|
|
|
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)
|
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
|
|
|
|
}
|
2022-09-08 10:32:25 +00:00
|
|
|
|
|
|
|
// EACLSource is the interface that wraps
|
|
|
|
// basic methods of extended ACL table source.
|
|
|
|
type EACLSource interface {
|
|
|
|
// GetEACL reads the table from the source by identifier.
|
|
|
|
// It returns any error encountered.
|
|
|
|
//
|
|
|
|
// GetEACL must return exactly one non-nil value.
|
|
|
|
//
|
|
|
|
// Must return apistatus.ErrEACLNotFound if requested
|
|
|
|
// eACL table is not in source.
|
|
|
|
GetEACL(cid.ID) (*EACL, error)
|
|
|
|
}
|