2022-04-22 07:18:21 +00:00
|
|
|
package layer
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/nspcc-dev/neofs-s3-gw/api/data"
|
|
|
|
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
2022-05-12 01:50:52 +00:00
|
|
|
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
2022-04-22 07:18:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// TreeService provide interface to interact with tree service using s3 data models.
|
|
|
|
type TreeService interface {
|
|
|
|
// PutSettingsNode update or create new settings node in tree service.
|
|
|
|
PutSettingsNode(context.Context, *cid.ID, string, *data.BucketSettings) error
|
|
|
|
|
|
|
|
// GetSettingsNode retrieves the settings node from the tree service and form data.BucketSettings.
|
|
|
|
//
|
2022-05-12 01:48:17 +00:00
|
|
|
// If node is not found returns ErrNodeNotFound error.
|
2022-04-22 07:18:21 +00:00
|
|
|
GetSettingsNode(context.Context, *cid.ID, string) (*data.BucketSettings, error)
|
2022-05-12 01:50:52 +00:00
|
|
|
|
|
|
|
GetNotificationConfigurationNodes(ctx context.Context, cnrID *cid.ID, latestOnly bool) ([]*oid.ID, []uint64, error)
|
|
|
|
PutNotificationConfigurationNode(ctx context.Context, cnrID *cid.ID, objID *oid.ID) error
|
|
|
|
DeleteNotificationConfigurationNode(ctx context.Context, cnrID *cid.ID, nodeID uint64) error
|
2022-04-22 07:18:21 +00:00
|
|
|
}
|
|
|
|
|
2022-05-12 01:48:17 +00:00
|
|
|
// ErrNodeNotFound is returned from Tree service in case of not found error.
|
|
|
|
var ErrNodeNotFound = errors.New("not found")
|