Documentation
¶
Index ¶
- type DbPersistence
- func (p *DbPersistence) AddItemToBatch(ctx context.Context, rec *RepoEventRecord, evt *events.XRPCStreamEvent) error
- func (p *DbPersistence) Flush(ctx context.Context) error
- func (p *DbPersistence) Persist(ctx context.Context, e *events.XRPCStreamEvent) error
- func (p *DbPersistence) Playback(ctx context.Context, since int64, cb func(*events.XRPCStreamEvent) error) error
- func (p *DbPersistence) RecordFromHandleChange(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Handle) (*RepoEventRecord, error)
- func (p *DbPersistence) RecordFromRepoAccount(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Account) (*RepoEventRecord, error)
- func (p *DbPersistence) RecordFromRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) (*RepoEventRecord, error)
- func (p *DbPersistence) RecordFromRepoIdentity(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Identity) (*RepoEventRecord, error)
- func (p *DbPersistence) RecordFromTombstone(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Tombstone) (*RepoEventRecord, error)
- func (p *DbPersistence) SetEventBroadcaster(brc func(*events.XRPCStreamEvent))
- func (p *DbPersistence) Shutdown(context.Context) error
- func (p *DbPersistence) TakeDownRepo(ctx context.Context, usr models.Uid) error
- type Options
- type PersistenceBatchItem
- type RepoEventRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbPersistence ¶
type DbPersistence struct {
// contains filtered or unexported fields
}
func NewDbPersistence ¶
func (*DbPersistence) AddItemToBatch ¶
func (p *DbPersistence) AddItemToBatch(ctx context.Context, rec *RepoEventRecord, evt *events.XRPCStreamEvent) error
func (*DbPersistence) Persist ¶
func (p *DbPersistence) Persist(ctx context.Context, e *events.XRPCStreamEvent) error
func (*DbPersistence) Playback ¶
func (p *DbPersistence) Playback(ctx context.Context, since int64, cb func(*events.XRPCStreamEvent) error) error
func (*DbPersistence) RecordFromHandleChange ¶
func (p *DbPersistence) RecordFromHandleChange(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Handle) (*RepoEventRecord, error)
func (*DbPersistence) RecordFromRepoAccount ¶
func (p *DbPersistence) RecordFromRepoAccount(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Account) (*RepoEventRecord, error)
func (*DbPersistence) RecordFromRepoCommit ¶
func (p *DbPersistence) RecordFromRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) (*RepoEventRecord, error)
func (*DbPersistence) RecordFromRepoIdentity ¶
func (p *DbPersistence) RecordFromRepoIdentity(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Identity) (*RepoEventRecord, error)
func (*DbPersistence) RecordFromTombstone ¶
func (p *DbPersistence) RecordFromTombstone(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Tombstone) (*RepoEventRecord, error)
func (*DbPersistence) SetEventBroadcaster ¶
func (p *DbPersistence) SetEventBroadcaster(brc func(*events.XRPCStreamEvent))
func (*DbPersistence) TakeDownRepo ¶
type Options ¶
type Options struct { MaxBatchSize int MinBatchSize int MaxTimeBetweenFlush time.Duration CheckBatchInterval time.Duration UIDCacheSize int DIDCacheSize int PlaybackBatchSize int HydrationConcurrency int }
func DefaultOptions ¶
func DefaultOptions() *Options
type PersistenceBatchItem ¶
type PersistenceBatchItem struct { Record *RepoEventRecord Event *events.XRPCStreamEvent }
type RepoEventRecord ¶
type RepoEventRecord struct { Seq uint `gorm:"primarykey"` Rev string Since *string Commit *models.DbCID Prev *models.DbCID NewHandle *string // NewHandle is only set if this is a handle change event Time time.Time Blobs []byte Repo models.Uid Type string Rebase bool // Active and Status are only set on RepoAccount events Active bool Status *string Ops []byte }
Click to show internal directories.
Click to hide internal directories.