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: Purge notification functionality #557

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
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
58 changes: 0 additions & 58 deletions object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,64 +518,6 @@ func (o *Object) FirstID() (v oid.ID, isSet bool) {
return
}

// NotificationInfo groups information about object notification
// that can be written to object.
//
// Topic is an optional field.
type NotificationInfo struct {
ni object.NotificationInfo
}

// Epoch returns object notification tick epoch.
//
// See also [NotificationInfo.SetEpoch].
func (n NotificationInfo) Epoch() uint64 {
return n.ni.Epoch()
}

// SetEpoch sets object notification tick epoch.
//
// See also [NotificationInfo.Epoch].
func (n *NotificationInfo) SetEpoch(epoch uint64) {
n.ni.SetEpoch(epoch)
}

// Topic return optional object notification topic.
//
// See also [NotificationInfo.SetTopic].
func (n NotificationInfo) Topic() string {
return n.ni.Topic()
}

// SetTopic sets optional object notification topic.
//
// See also [NotificationInfo.Topic].
func (n *NotificationInfo) SetTopic(topic string) {
n.ni.SetTopic(topic)
}

// NotificationInfo returns notification info read from the object structure.
// Returns any error that appeared during notification information parsing.
//
// See also [Object.SetNotification].
func (o *Object) NotificationInfo() (*NotificationInfo, error) {
ni, err := object.GetNotificationInfo((*object.Object)(o))
if err != nil {
return nil, err
}

return &NotificationInfo{
ni: *ni,
}, nil
}

// SetNotification writes [NotificationInfo] to the object structure.
//
// See also [Object.NotificationInfo].
func (o *Object) SetNotification(ni NotificationInfo) {
object.WriteNotificationInfo((*object.Object)(o), ni.ni)
}

// SplitID return split identity of split object. If object is not split returns nil.
//
// See also [Object.SetSplitID].
Expand Down
5 changes: 0 additions & 5 deletions object/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,6 @@ func (f *SearchFilters) AddObjectOwnerIDFilter(m SearchMatchType, id user.ID) {
f.addFilter(m, FilterOwnerID, id)
}

// AddNotificationEpochFilter adds a filter by epoch. This epoch is not about expiration, but about notification production.
func (f *SearchFilters) AddNotificationEpochFilter(epoch uint64) {
f.addFilter(MatchStringEqual, v2object.SysAttributeTickEpoch, staticStringer(strconv.FormatUint(epoch, 10)))
}

// ToV2 converts [SearchFilters] to [v2object.SearchFilter] slice.
func (f SearchFilters) ToV2() []v2object.SearchFilter {
result := make([]v2object.SearchFilter, len(f))
Expand Down
Loading