frostfs-node/pkg/core/container/storage.go
aarifullin 0f45e3d344
All checks were successful
DCO action / DCO (pull_request) Successful in 2m10s
Vulncheck / Vulncheck (pull_request) Successful in 3m26s
Build / Build Components (1.20) (pull_request) Successful in 5m41s
Build / Build Components (1.21) (pull_request) Successful in 5m44s
Tests and linters / Staticcheck (pull_request) Successful in 7m10s
Tests and linters / Lint (pull_request) Successful in 8m14s
Tests and linters / Tests (1.21) (pull_request) Successful in 14m24s
Tests and linters / Tests (1.20) (pull_request) Successful in 14m41s
Tests and linters / Tests with -race (pull_request) Successful in 14m38s
[#804] ape: Implement boltdb storage for local overrides
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2023-12-07 19:08:41 +03:00

73 lines
2.2 KiB
Go

package container
import (
"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"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
)
// Container groups information about the FrostFS container stored in the FrostFS network.
type Container struct {
// Container structure.
Value container.Container
// Signature of the Value.
Signature frostfscrypto.Signature
// Session within which Value was created. Nil means session absence.
Session *session.Container
}
// DelInfo contains info about removed container.
type DelInfo struct {
// Container owner.
Owner user.ID
// Epoch indicates when the container was removed.
Epoch uint64
}
// Source is an interface that wraps
// basic container receiving method.
type Source interface {
// Get reads the container from the storage by its identifier.
// It returns the pointer to the requested container and any error encountered.
//
// Get must return exactly one non-nil value.
// Get must return an error of type apistatus.ContainerNotFound if the container is not in the storage.
//
// Implementations must not retain the container pointer and modify
// the container through it.
Get(cid.ID) (*Container, error)
DeletionInfo(cid.ID) (*DelInfo, error)
}
// EACL groups information about the FrostFS container's extended ACL stored in
// the FrostFS network.
type EACL struct {
// Extended ACL structure.
Value *eacl.Table
// Signature of the Value.
Signature frostfscrypto.Signature
// Session within which Value was set. Nil means session absence.
Session *session.Container
}
// 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)
}