+1
-1
automod/cachestore/doc.go
+1
-1
automod/cachestore/doc.go
···
1
-
// Automod component for caching arbitary data (as JSON strings) with a fixed TTL and purging.
1
+
// Automod component for caching arbitrary data (as JSON strings) with a fixed TTL and purging.
2
2
//
3
3
// Includes an interface and implementations using redis and in-process memory.
4
4
//
+1
-1
automod/countstore/doc.go
+1
-1
automod/countstore/doc.go
+1
automod/engine/fetchaccountmeta.go
+1
automod/engine/fetchaccountmeta.go
···
11
11
"github.com/bluesky-social/indigo/atproto/syntax"
12
12
)
13
13
14
+
// Helper to hydrate metadata about an account from several sources: PDS (if access), mod service (if access), public identity resolution
14
15
func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) (*AccountMeta, error) {
15
16
16
17
// wipe parsed public key; it's a waste of space and can't serialize
+4
automod/engine/ruleset.go
+4
automod/engine/ruleset.go
···
8
8
lexutil "github.com/bluesky-social/indigo/lex/util"
9
9
)
10
10
11
+
// Holds configuration of which rules of various types should be run, and helps dispatch events to those rules.
11
12
type RuleSet struct {
12
13
PostRules []PostRuleFunc
13
14
ProfileRules []ProfileRuleFunc
···
17
18
BlobRules []BlobRuleFunc
18
19
}
19
20
21
+
// Executes all the various record-related rules. Only dispatches execution, does no other de-dupe or pre/post processing.
20
22
func (r *RuleSet) CallRecordRules(c *RecordContext) error {
21
23
// first the generic rules
22
24
for _, f := range r.RecordRules {
···
62
64
return nil
63
65
}
64
66
67
+
// NOTE: this will probably be removed and merged in to `CallRecordRules`
65
68
func (r *RuleSet) CallRecordDeleteRules(c *RecordContext) error {
66
69
for _, f := range r.RecordDeleteRules {
67
70
err := f(c)
···
72
75
return nil
73
76
}
74
77
78
+
// Executes rules for identity update events.
75
79
func (r *RuleSet) CallIdentityRules(c *AccountContext) error {
76
80
for _, f := range r.IdentityRules {
77
81
err := f(c)