Documentation
¶
Index ¶
- type Consumer
- func (c *Consumer) HandleCreatePost(ctx context.Context, repo, rkey string, indexedAt time.Time, ...) error
- func (c *Consumer) HandleCreateRecord(ctx context.Context, actorID int64, repo string, collection string, ...) (*time.Time, error)
- func (c *Consumer) HandleDeletePost(ctx context.Context, repo, rkey string) error
- func (c *Consumer) HandleDeleteRecord(ctx context.Context, actorID int64, repo string, collection string, ...) error
- func (c *Consumer) OnCommit(ctx context.Context, evt *models.Event) error
- func (c *Consumer) OnEvent(ctx context.Context, evt *models.Event) error
- func (c *Consumer) ReadCursor(ctx context.Context) error
- func (c *Consumer) Shutdown() error
- func (c *Consumer) TrimRecentPosts(ctx context.Context, maxAge time.Duration) error
- func (c *Consumer) WriteCursor(ctx context.Context) error
- type Delete
- type Progress
- type URI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
SocketURL string
Progress *Progress
Logger *zap.SugaredLogger
RedisClient *redis.Client
ProgressKey string
Store *store.Store
// contains filtered or unexported fields
}
Consumer is the consumer of the firehose
func NewConsumer ¶
func NewConsumer( ctx context.Context, logger *zap.SugaredLogger, redisClient *redis.Client, redisPrefix string, store *store.Store, socketURL string, graphdRoot string, shardDBNodes []string, ) (*Consumer, error)
NewConsumer creates a new consumer
func (*Consumer) HandleCreatePost ¶
func (*Consumer) HandleCreateRecord ¶
func (c *Consumer) HandleCreateRecord( ctx context.Context, actorID int64, repo string, collection string, rkey string, rec json.RawMessage, ) (*time.Time, error)
HandleCreateRecord handles a create record event from the firehose
func (*Consumer) HandleDeletePost ¶
func (*Consumer) HandleDeleteRecord ¶
func (c *Consumer) HandleDeleteRecord( ctx context.Context, actorID int64, repo string, collection string, rkey string, ) error
HandleDeleteRecord handles a delete record event from the firehose
func (*Consumer) OnCommit ¶
HandleRepoCommit handles a repo commit event from the firehose and processes the records
func (*Consumer) ReadCursor ¶
ReadCursor reads the cursor from redis
func (*Consumer) TrimRecentPosts ¶
TrimRecentPosts trims the recent posts from the recent_posts table and the active posters from redis
Click to show internal directories.
Click to hide internal directories.