frostfs-s3-gw/api/layer/tree_service.go
Denis Kirillov 9ed081db3e [#407] Add service tree client prototype
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2022-07-22 15:19:16 +03:00

23 lines
769 B
Go

package layer
import (
"context"
"errors"
"github.com/nspcc-dev/neofs-s3-gw/api/data"
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
)
// 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.
//
// If node is not found returns ErrNotFound error.
GetSettingsNode(context.Context, *cid.ID, string) (*data.BucketSettings, error)
}
// ErrNotFound is returned from Tree service in case of not found error.
var ErrNotFound = errors.New("not found")