2020-09-21 10:07:12 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
2021-11-10 07:08:33 +00:00
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/container"
|
|
|
|
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
2020-09-21 10:07:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Source is an interface that wraps
|
|
|
|
// basic container receiving method.
|
|
|
|
type Source interface {
|
|
|
|
// Get reads the container from the storage by identifier.
|
|
|
|
// It returns the pointer to requested container and any error encountered.
|
|
|
|
//
|
|
|
|
// Get must return exactly one non-nil value.
|
|
|
|
// Get must return ErrNotFound if the container is not in storage.
|
|
|
|
//
|
|
|
|
// Implementations must not retain the container pointer and modify
|
|
|
|
// the container through it.
|
2021-05-31 11:03:17 +00:00
|
|
|
Get(*cid.ID) (*container.Container, error)
|
2020-09-21 10:07:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ErrNotFound is the error returned when container was not found in storage.
|
|
|
|
var ErrNotFound = errors.New("container not found")
|
2020-11-24 12:49:02 +00:00
|
|
|
|
|
|
|
// ErrEACLNotFound is returned by eACL storage implementations when
|
|
|
|
// requested eACL table is not in storage.
|
|
|
|
var ErrEACLNotFound = errors.New("extended ACL table is not set for this container")
|