Skip to content

Commit

Permalink
object: Purge notification functionality (#557)
Browse files Browse the repository at this point in the history
* based on and blocked by
nspcc-dev/neofs-api#279
  • Loading branch information
roman-khimov authored Feb 27, 2024
2 parents 846741c + 86f9df0 commit fa430c2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
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

0 comments on commit fa430c2

Please sign in to comment.