-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfilters.go
61 lines (55 loc) · 1.64 KB
/
filters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package processing
import (
vocab "github.com/go-ap/activitypub"
)
// Filterable can filter objects by Type and ID
// This should be the minimal interface a filter object should implement for the storage layer
// to work.
// It also allows for an activitypub.IRI to be used as a filter.
type Filterable interface {
GetLink() vocab.IRI
}
type FilterableItems interface {
Filterable
Types() vocab.ActivityVocabularyTypes
IRIs() vocab.IRIs
}
// FilterableCollection can filter collections
type FilterableCollection interface {
FilterableObject
TotalItemsGt() uint
TotalItemsLt() uint
TotalItemsEq() uint
TotalItemsGtE() uint
TotalItemsLtE() uint
Contains() vocab.IRIs
}
// FilterableActivity can filter activities
type FilterableActivity interface {
FilterableObject
Actors() vocab.IRIs
Objects() vocab.IRIs
Targets() vocab.IRIs
}
// FilterableObject can filter objects
type FilterableObject interface {
FilterableItems
AttributedTo() vocab.IRIs
InReplyTo() vocab.IRIs
MediaTypes() []vocab.MimeType
Names() []string
Content() []string
//PublishedBefore() time.Time
//PublishedAfter() time.Time
URLs() vocab.IRIs
// Audience returns the list of IRIs to check against full Audience targeting for the object
// It should include all relevant fields: To, CC, BTo, BCC, and Audience
// ---
// An element of the Audience is used to get its Inbox end-point and then disseminate the current Activity
// to it.
Audience() vocab.IRIs
// Context returns the list of IRIs to check against an Object's Context property.
Context() vocab.IRIs
// Generator returns the list of IRIs to check against an Object's Generator property.
Generator() vocab.IRIs
}