Documentation ¶
Index ¶
- Constants
- type CrawlDispatcher
- func (c *CrawlDispatcher) AddToCatchupQueue(ctx context.Context, host *models.PDS, u *models.ActorInfo, ...) error
- func (c *CrawlDispatcher) CatchupRepoGaugePoller()
- func (c *CrawlDispatcher) Crawl(ctx context.Context, ai *models.ActorInfo) error
- func (c *CrawlDispatcher) RepoInSlowPath(ctx context.Context, uid models.Uid) bool
- func (c *CrawlDispatcher) Run()
- func (c *CrawlDispatcher) Shutdown()
- type CrawlRepoFetcher
- type DidResolver
- type Indexer
- func (ix *Indexer) DidForUser(ctx context.Context, uid models.Uid) (string, error)
- func (ix *Indexer) GetPost(ctx context.Context, uri string) (*models.FeedPost, error)
- func (ix *Indexer) GetPostOrMissing(ctx context.Context, uri string) (*models.FeedPost, error)
- func (ix *Indexer) GetUserOrMissing(ctx context.Context, did string) (*models.ActorInfo, error)
- func (ix *Indexer) HandleRepoEvent(ctx context.Context, evt *repomgr.RepoEvent) error
- func (ix *Indexer) LookupUser(ctx context.Context, id models.Uid) (*models.ActorInfo, error)
- func (ix *Indexer) LookupUserByDid(ctx context.Context, did string) (*models.ActorInfo, error)
- func (ix *Indexer) LookupUserByHandle(ctx context.Context, handle string) (*models.ActorInfo, error)
- func (ix *Indexer) Shutdown()
- type KeyManager
- type RepoFetcher
Constants ¶
View Source
const MaxEventSliceLength = 1000000
View Source
const MaxOpsSliceLength = 200
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrawlDispatcher ¶
type CrawlDispatcher struct {
// contains filtered or unexported fields
}
func NewCrawlDispatcher ¶
func NewCrawlDispatcher(repoFetcher CrawlRepoFetcher, concurrency int, log *slog.Logger) (*CrawlDispatcher, error)
func (*CrawlDispatcher) AddToCatchupQueue ¶
func (c *CrawlDispatcher) AddToCatchupQueue(ctx context.Context, host *models.PDS, u *models.ActorInfo, evt *comatproto.SyncSubscribeRepos_Commit) error
func (*CrawlDispatcher) CatchupRepoGaugePoller ¶
func (c *CrawlDispatcher) CatchupRepoGaugePoller()
func (*CrawlDispatcher) RepoInSlowPath ¶
func (*CrawlDispatcher) Run ¶
func (c *CrawlDispatcher) Run()
func (*CrawlDispatcher) Shutdown ¶
func (c *CrawlDispatcher) Shutdown()
type CrawlRepoFetcher ¶
this is what we need of RepoFetcher
type DidResolver ¶
type Indexer ¶
type Indexer struct { Crawler *CrawlDispatcher SendRemoteFollow func(context.Context, string, uint) error CreateExternalUser func(context.Context, string) (*models.ActorInfo, error) ApplyPDSClientSettings func(*xrpc.Client) // contains filtered or unexported fields }
func NewIndexer ¶
func NewIndexer(db *gorm.DB, notifman notifs.NotificationManager, evtman *events.EventManager, didr did.Resolver, fetcher *RepoFetcher, crawl, aggregate, spider bool) (*Indexer, error)
func (*Indexer) DidForUser ¶
func (*Indexer) GetPostOrMissing ¶
func (*Indexer) GetUserOrMissing ¶
func (*Indexer) HandleRepoEvent ¶
func (*Indexer) LookupUser ¶
func (*Indexer) LookupUserByDid ¶
func (*Indexer) LookupUserByHandle ¶
type KeyManager ¶
type KeyManager struct {
// contains filtered or unexported fields
}
func NewKeyManager ¶
func NewKeyManager(didr DidResolver, k *did.PrivKey) *KeyManager
func (*KeyManager) SignForUser ¶
func (*KeyManager) VerifyUserSignature ¶
type RepoFetcher ¶
type RepoFetcher struct { Limiters map[uint]*rate.Limiter LimitMux sync.RWMutex MaxConcurrency int ApplyPDSClientSettings func(*xrpc.Client) // contains filtered or unexported fields }
func NewRepoFetcher ¶
func NewRepoFetcher(db *gorm.DB, rm *repomgr.RepoManager, maxConcurrency int) *RepoFetcher
func (*RepoFetcher) FetchAndIndexRepo ¶
func (rf *RepoFetcher) FetchAndIndexRepo(ctx context.Context, job *crawlWork) error
TODO: since this function is the only place we depend on the repomanager, i wonder if this should be wired some other way?
func (*RepoFetcher) GetLimiter ¶
func (rf *RepoFetcher) GetLimiter(pdsID uint) *rate.Limiter
func (*RepoFetcher) GetOrCreateLimiter ¶
func (rf *RepoFetcher) GetOrCreateLimiter(pdsID uint, pdsrate float64) *rate.Limiter
func (*RepoFetcher) SetLimiter ¶
func (rf *RepoFetcher) SetLimiter(pdsID uint, lim *rate.Limiter)
Click to show internal directories.
Click to hide internal directories.