Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object: Export constant key to the expiration attribute #504

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions object/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ import (
"github.com/nspcc-dev/neofs-api-go/v2/object"
)

// Various system attributes.
const (
// AttributeExpirationEpoch is a key to an object attribute that determines
// after what epoch the object becomes expired. Objects that do not have this
// attribute never expire.
//
// Reaction of NeoFS system components to the objects' 'expired' property may
// vary. For example, in the basic scenario, expired objects are auto-deleted
// from the storage. Detailed behavior can be found in the NeoFS Specification.
//
// Note that the value determines exactly the last epoch of the object's
// relevance: for example, with the value N, the object is relevant in epoch N
// and expired in any epoch starting from N+1.
AttributeExpirationEpoch = object.SysAttributeExpEpoch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need "key", "system" words here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key is missing in existing ones, system - may be added, but i don't think user will care much and we'll have non-system expiration attribute

u think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont mind keeping it that way

Copy link
Member

@roman-khimov roman-khimov Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"key" is kinda obvious (in that it's not a value, but some attribute name/key). "system" as well, we don't have constants for random attributes here, we only have ones that have some meaning to the system.

So it's a good name as is.

)

// Attribute represents v2-compatible object attribute.
type Attribute object.Attribute

Expand Down