diff --git a/automod/cachestore/doc.go b/automod/cachestore/doc.go index 246b0baa..e5c31ba1 100644 --- a/automod/cachestore/doc.go +++ b/automod/cachestore/doc.go @@ -1,4 +1,4 @@ -// Automod component for caching arbitary data (as JSON strings) with a fixed TTL and purging. +// Automod component for caching arbitrary data (as JSON strings) with a fixed TTL and purging. // // Includes an interface and implementations using redis and in-process memory. // diff --git a/automod/countstore/doc.go b/automod/countstore/doc.go index 0bc66d4b..66becbfa 100644 --- a/automod/countstore/doc.go +++ b/automod/countstore/doc.go @@ -1,2 +1,2 @@ -// Interface for fast atomic counters, and separate implmentations using redis and in-process memory. +// Interface for fast atomic counters, and separate implementations using redis and in-process memory. package countstore diff --git a/automod/engine/fetchaccountmeta.go b/automod/engine/fetchaccountmeta.go index 2a0bca90..b1408089 100644 --- a/automod/engine/fetchaccountmeta.go +++ b/automod/engine/fetchaccountmeta.go @@ -11,6 +11,7 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" ) +// Helper to hydrate metadata about an account from several sources: PDS (if access), mod service (if access), public identity resolution func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) (*AccountMeta, error) { // wipe parsed public key; it's a waste of space and can't serialize diff --git a/automod/engine/ruleset.go b/automod/engine/ruleset.go index cf9f98d0..72095b69 100644 --- a/automod/engine/ruleset.go +++ b/automod/engine/ruleset.go @@ -8,6 +8,7 @@ import ( lexutil "github.com/bluesky-social/indigo/lex/util" ) +// Holds configuration of which rules of various types should be run, and helps dispatch events to those rules. type RuleSet struct { PostRules []PostRuleFunc ProfileRules []ProfileRuleFunc @@ -17,6 +18,7 @@ type RuleSet struct { BlobRules []BlobRuleFunc } +// Executes all the various record-related rules. Only dispatches execution, does no other de-dupe or pre/post processing. func (r *RuleSet) CallRecordRules(c *RecordContext) error { // first the generic rules for _, f := range r.RecordRules { @@ -62,6 +64,7 @@ func (r *RuleSet) CallRecordRules(c *RecordContext) error { return nil } +// NOTE: this will probably be removed and merged in to `CallRecordRules` func (r *RuleSet) CallRecordDeleteRules(c *RecordContext) error { for _, f := range r.RecordDeleteRules { err := f(c) @@ -72,6 +75,7 @@ func (r *RuleSet) CallRecordDeleteRules(c *RecordContext) error { return nil } +// Executes rules for identity update events. func (r *RuleSet) CallIdentityRules(c *AccountContext) error { for _, f := range r.IdentityRules { err := f(c)