consumer

package
v0.0.0-...-adf259e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2025 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Overview

Code for consuming from atproto firehose and ozone event stream, pushing events in to automod engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirehoseConsumer

type FirehoseConsumer struct {
	Parallelism int
	Logger      *slog.Logger
	RedisClient *redis.Client
	Engine      *automod.Engine
	Host        string
	// contains filtered or unexported fields
}

func (*FirehoseConsumer) HandleRepoCommit

NOTE: for now, this function basically never errors, just logs and returns nil. Should think through error processing better.

func (*FirehoseConsumer) PersistCursor

func (fc *FirehoseConsumer) PersistCursor(ctx context.Context) error

func (*FirehoseConsumer) ReadLastCursor

func (fc *FirehoseConsumer) ReadLastCursor(ctx context.Context) (int64, error)

func (*FirehoseConsumer) Run

func (fc *FirehoseConsumer) Run(ctx context.Context) error

func (*FirehoseConsumer) RunPersistCursor

func (fc *FirehoseConsumer) RunPersistCursor(ctx context.Context) error

this method runs in a loop, persisting the current cursor state every 5 seconds

type OzoneConsumer

type OzoneConsumer struct {
	Logger      *slog.Logger
	RedisClient *redis.Client
	OzoneClient *xrpc.Client
	Engine      *automod.Engine
	// contains filtered or unexported fields
}

func (*OzoneConsumer) HandleOzoneEvent

func (oc *OzoneConsumer) HandleOzoneEvent(ctx context.Context, eventView *toolsozone.ModerationDefs_ModEventView) error

func (*OzoneConsumer) PersistCursor

func (oc *OzoneConsumer) PersistCursor(ctx context.Context) error

func (*OzoneConsumer) ReadLastCursor

func (oc *OzoneConsumer) ReadLastCursor(ctx context.Context) (string, error)

func (*OzoneConsumer) Run

func (oc *OzoneConsumer) Run(ctx context.Context) error

func (*OzoneConsumer) RunPersistCursor

func (oc *OzoneConsumer) RunPersistCursor(ctx context.Context) error

this method runs in a loop, persisting the current cursor state every 5 seconds

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL