Documentation
¶
Index ¶
- func StripCIDs(data []byte) ([]byte, error)
- type Indexer
- func (i *Indexer) HandleCreateRecord(ctx context.Context, repo string, collection string, rkey string, ...) error
- func (i *Indexer) HandleDeleteRecord(ctx context.Context, repo string, collection string, rkey string, ...) error
- func (i *Indexer) HandleUpdateRecord(ctx context.Context, repo string, collection string, rkey string, ...) error
- func (i *Indexer) OnCommit(ctx context.Context, evt *models.Event) error
- func (i *Indexer) OnEvent(ctx context.Context, evt *models.Event) error
- func (i *Indexer) ReadCursor(ctx context.Context) error
- func (i *Indexer) Shutdown() error
- func (i *Indexer) WriteCursor(ctx context.Context) error
- type Progress
- type URI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Indexer ¶
type Indexer struct {
SocketURL string
Progress *Progress
Logger *slog.Logger
RedisClient *redis.Client
ProgressKey string
Store *store.Store
BatchInserter *store.BatchInserter
}
Indexer is the indexer for the firehose
func NewIndexer ¶
func NewIndexer( ctx context.Context, logger *slog.Logger, redisClient *redis.Client, redisPrefix string, chStore *store.Store, socketURL string, ) (*Indexer, error)
NewIndexer creates a new indexer
func (*Indexer) HandleCreateRecord ¶
func (i *Indexer) HandleCreateRecord( ctx context.Context, repo string, collection string, rkey string, rec json.RawMessage, eventTime time.Time, timeUS int64, ) error
HandleCreateRecord handles a create record event
func (*Indexer) HandleDeleteRecord ¶
func (i *Indexer) HandleDeleteRecord( ctx context.Context, repo string, collection string, rkey string, eventTime time.Time, timeUS int64, ) error
HandleDeleteRecord handles a delete record event
func (*Indexer) HandleUpdateRecord ¶
func (i *Indexer) HandleUpdateRecord( ctx context.Context, repo string, collection string, rkey string, rec json.RawMessage, eventTime time.Time, timeUS int64, ) error
HandleUpdateRecord handles an update record event
func (*Indexer) ReadCursor ¶
ReadCursor reads the cursor from redis
Click to show internal directories.
Click to hide internal directories.