From 86f9df0371e31edad02b642fd610623c2de88a7d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 26 Feb 2024 08:26:37 +0400 Subject: [PATCH] object: Purge notification functionality It was removed from the protocol within https://github.com/nspcc-dev/neofs-api/issues/279. Signed-off-by: Leonard Lyubich --- object/object.go | 58 ------------------------------------------------ object/search.go | 5 ----- 2 files changed, 63 deletions(-) diff --git a/object/object.go b/object/object.go index e57ff5ed..6a0c66bc 100644 --- a/object/object.go +++ b/object/object.go @@ -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]. diff --git a/object/search.go b/object/search.go index 143fc5fb..effbd024 100644 --- a/object/search.go +++ b/object/search.go @@ -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))