[#382] Refactor neofs related types

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-03-25 13:28:39 +03:00 committed by Alex Vanin
parent 4322da90d8
commit c399cfbdda
9 changed files with 101 additions and 242 deletions

View file

@ -127,7 +127,7 @@ func (n *layer) createContainer(ctx context.Context, p *CreateBucketParams) (*da
bktInfo := &data.BucketInfo{
Name: p.Name,
Owner: n.Owner(ctx),
Created: time.Now(),
Created: time.Now(), // this can be a little incorrect since the real time is set later
BasicACL: p.ACL,
LocationConstraint: p.LocationConstraint,
ObjectLockEnabled: p.ObjectLockEnabled,
@ -152,7 +152,6 @@ func (n *layer) createContainer(ctx context.Context, p *CreateBucketParams) (*da
Policy: *p.Policy,
Name: p.Name,
SessionToken: p.SessionToken,
Time: bktInfo.Created,
BasicACL: acl.BasicACL(p.ACL),
AdditionalAttributes: attributes,
}); err != nil {

View file

@ -33,9 +33,6 @@ type PrmContainerCreate struct {
// Token of the container's creation session. Nil means session absence.
SessionToken *session.Token
// Time when container is created.
Time time.Time
// Basic ACL of the container.
BasicACL acl.BasicACL
@ -144,6 +141,7 @@ var ErrAccessDenied = errors.New("access denied")
// NeoFS represents virtual connection to NeoFS network.
type NeoFS interface {
// CreateContainer creates and saves parameterized container in NeoFS.
// It sets 'Timestamp' attribute to current time.
// Returns ID of the saved container.
//
// Returns exactly one non-nil value. Returns any error encountered which
@ -206,6 +204,7 @@ type NeoFS interface {
ReadObject(context.Context, PrmObjectRead) (*ObjectPart, error)
// CreateObject creates and saves parameterized object in the NeoFS container.
// It sets 'Timestamp' attribute to current time.
// Returns ID of the saved object.
//
// Creation time should be written into object (UTC).