Documentation ¶
Index ¶
- Variables
- func MetricsMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- type AdminRequestCrawlRequest
- type AuthToken
- type BGS
- func (bgs *BGS) CompleteResync(resync PDSResync)
- func (bgs *BGS) CreateAdminToken(tok string) error
- func (bgs *BGS) EventsHandler(c echo.Context) error
- func (bgs *BGS) GetResync(pds models.PDS) (PDSResync, bool)
- func (s *BGS) HandleComAtprotoSyncGetBlocks(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncGetLatestCommit(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncGetRecord(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncGetRepo(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncListRepos(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncNotifyOfUpdate(c echo.Context) error
- func (s *BGS) HandleComAtprotoSyncRequestCrawl(c echo.Context) error
- func (bgs *BGS) HandleHealthCheck(c echo.Context) error
- func (bgs *BGS) HandleHomeMessage(c echo.Context) error
- func (bgs *BGS) LoadOrStoreResync(pds models.PDS) (PDSResync, bool)
- func (s *BGS) RegisterHandlersAppBsky(e *echo.Echo) error
- func (s *BGS) RegisterHandlersComAtproto(e *echo.Echo) error
- func (bgs *BGS) ResyncPDS(ctx context.Context, pds models.PDS) error
- func (bgs *BGS) ReverseTakedown(ctx context.Context, did string) error
- func (bgs *BGS) SetResyncStatus(id uint, status string) PDSResync
- func (bgs *BGS) Shutdown() []error
- func (bgs *BGS) Start(addr string) error
- func (bgs *BGS) StartDebug(listen string) error
- func (bgs *BGS) StartMetrics(listen string) error
- func (bgs *BGS) StartWithListener(listen net.Listener) error
- func (bgs *BGS) TakeDownRepo(ctx context.Context, did string) error
- func (bgs *BGS) UpdateAccountStatus(ctx context.Context, did string, status string) error
- func (bgs *BGS) UpdateResync(resync PDSResync)
- type BGSConfig
- type Compactor
- type CompactorOptions
- type CompactorState
- type HealthStatus
- type IndexCallback
- type Limiters
- type NextStrategy
- type PDSResync
- type RateLimitChangeRequest
- type SlurpConfig
- type Slurper
- func (s *Slurper) AddTrustedDomain(domain string) error
- func (s *Slurper) GetActiveList() []string
- func (s *Slurper) GetLimiters(pdsID uint) *Limiters
- func (s *Slurper) GetNewPDSPerDayLimit() int64
- func (s *Slurper) GetNewSubsDisabledState() bool
- func (s *Slurper) GetOrCreateLimiters(pdsID uint, perSecLimit int64, perHourLimit int64, perDayLimit int64) *Limiters
- func (s *Slurper) GetTrustedDomains() []string
- func (s *Slurper) KillUpstreamConnection(host string, block bool) error
- func (s *Slurper) RemoveTrustedDomain(domain string) error
- func (s *Slurper) RestartAll() error
- func (s *Slurper) SetLimits(pdsID uint, perSecLimit int64, perHourLimit int64, perDayLimit int64)
- func (s *Slurper) SetNewPDSPerDayLimit(limit int64) error
- func (s *Slurper) SetNewSubsDisabled(dis bool) error
- func (s *Slurper) SetTrustedDomains(domains []string) error
- func (s *Slurper) Shutdown() []error
- func (s *Slurper) SubscribeToPds(ctx context.Context, host string, reg bool, adminOverride bool) error
- type SlurperOptions
- type SocketConsumer
- type User
- type UserCount
- type XRPCError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNewSubsDisabled = fmt.Errorf("new subscriptions temporarily disabled")
View Source
var ErrNoActiveConnection = fmt.Errorf("no active connection to host")
View Source
var ErrTimeoutShutdown = fmt.Errorf("timed out waiting for new events")
View Source
var EventsTimeout = time.Minute
Functions ¶
func MetricsMiddleware ¶
func MetricsMiddleware(next echo.HandlerFunc) echo.HandlerFunc
MetricsMiddleware defines handler function for metrics middleware
Types ¶
type AdminRequestCrawlRequest ¶
type AdminRequestCrawlRequest struct {
Hostname string `json:"hostname"`
}
type BGS ¶
func NewBGS ¶
func NewBGS(db *gorm.DB, ix *indexer.Indexer, repoman *repomgr.RepoManager, evtman *events.EventManager, didr did.Resolver, rf *indexer.RepoFetcher, hr api.HandleResolver, config *BGSConfig) (*BGS, error)
func (*BGS) CompleteResync ¶
func (*BGS) CreateAdminToken ¶
func (*BGS) EventsHandler ¶
func (*BGS) HandleComAtprotoSyncGetBlocks ¶
func (*BGS) HandleComAtprotoSyncGetLatestCommit ¶
func (*BGS) HandleComAtprotoSyncGetRecord ¶
func (*BGS) HandleComAtprotoSyncGetRepo ¶
func (*BGS) HandleComAtprotoSyncListRepos ¶
func (*BGS) HandleComAtprotoSyncNotifyOfUpdate ¶
func (*BGS) HandleComAtprotoSyncRequestCrawl ¶
func (*BGS) HandleHealthCheck ¶
func (*BGS) HandleHomeMessage ¶
func (*BGS) RegisterHandlersAppBsky ¶
func (*BGS) RegisterHandlersComAtproto ¶
func (*BGS) ReverseTakedown ¶
func (*BGS) StartDebug ¶
Disabled for now, maybe reimplement behind admin auth later
func (*BGS) StartMetrics ¶
func (*BGS) UpdateAccountStatus ¶
func (*BGS) UpdateResync ¶
type BGSConfig ¶
type BGSConfig struct { SSL bool CompactInterval time.Duration DefaultRepoLimit int64 ConcurrencyPerPDS int64 MaxQueuePerPDS int64 NumCompactionWorkers int // NextCrawlers gets forwarded POST /xrpc/com.atproto.sync.requestCrawl NextCrawlers []*url.URL }
func DefaultBGSConfig ¶
func DefaultBGSConfig() *BGSConfig
type Compactor ¶
type Compactor struct {
// contains filtered or unexported fields
}
Compactor is a compactor daemon that compacts repos in the background
func NewCompactor ¶
func NewCompactor(opts *CompactorOptions) *Compactor
func (*Compactor) EnqueueAllRepos ¶
func (c *Compactor) EnqueueAllRepos(ctx context.Context, bgs *BGS, lim int, shardCount int, fast bool) error
EnqueueAllRepos enqueues all repos for compaction lim is the maximum number of repos to enqueue shardCount is the number of shards to compact per user (0 = default of 50) fast is whether to use the fast compaction method (skip large shards)
func (*Compactor) EnqueueRepo ¶
type CompactorOptions ¶
type CompactorOptions struct { RequeueInterval time.Duration RequeueLimit int RequeueShardCount int RequeueFast bool NumWorkers int }
func DefaultCompactorOptions ¶
func DefaultCompactorOptions() *CompactorOptions
type CompactorState ¶
type CompactorState struct {
// contains filtered or unexported fields
}
type HealthStatus ¶
type IndexCallback ¶
type Limiters ¶
type Limiters struct { PerSecond *slidingwindow.Limiter PerHour *slidingwindow.Limiter PerDay *slidingwindow.Limiter }
type RateLimitChangeRequest ¶
type SlurpConfig ¶
type Slurper ¶
type Slurper struct { LimitMux sync.RWMutex Limiters map[uint]*Limiters DefaultPerSecondLimit int64 DefaultPerHourLimit int64 DefaultPerDayLimit int64 DefaultCrawlLimit rate.Limit DefaultRepoLimit int64 ConcurrencyPerPDS int64 MaxQueuePerPDS int64 NewPDSPerDayLimiter *slidingwindow.Limiter // contains filtered or unexported fields }
TODO: rename me
func NewSlurper ¶
func NewSlurper(db *gorm.DB, cb IndexCallback, opts *SlurperOptions) (*Slurper, error)
func (*Slurper) AddTrustedDomain ¶
func (*Slurper) GetActiveList ¶
func (*Slurper) GetLimiters ¶
func (*Slurper) GetNewPDSPerDayLimit ¶
func (*Slurper) GetNewSubsDisabledState ¶
func (*Slurper) GetOrCreateLimiters ¶
func (*Slurper) GetTrustedDomains ¶
func (*Slurper) KillUpstreamConnection ¶
func (*Slurper) RemoveTrustedDomain ¶
func (*Slurper) RestartAll ¶
func (*Slurper) SetNewPDSPerDayLimit ¶
func (*Slurper) SetNewSubsDisabled ¶
func (*Slurper) SetTrustedDomains ¶
type SlurperOptions ¶
type SlurperOptions struct { SSL bool DefaultPerSecondLimit int64 DefaultPerHourLimit int64 DefaultPerDayLimit int64 DefaultCrawlLimit rate.Limit DefaultRepoLimit int64 ConcurrencyPerPDS int64 MaxQueuePerPDS int64 }
func DefaultSlurperOptions ¶
func DefaultSlurperOptions() *SlurperOptions
type SocketConsumer ¶
type User ¶
type User struct { ID models.Uid `gorm:"primarykey;index:idx_user_id_active,where:taken_down = false AND tombstoned = false"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Handle sql.NullString `gorm:"index"` Did string `gorm:"uniqueIndex"` PDS uint ValidHandle bool `gorm:"default:true"` // TakenDown is set to true if the user in question has been taken down. // A user in this state will have all future events related to it dropped // and no data about this user will be served. TakenDown bool Tombstoned bool // UpstreamStatus is the state of the user as reported by the upstream PDS UpstreamStatus string `gorm:"index"` // contains filtered or unexported fields }
func (*User) GetTakenDown ¶
func (*User) GetTombstoned ¶
func (*User) GetUpstreamStatus ¶
func (*User) SetTakenDown ¶
func (*User) SetTombstoned ¶
func (*User) SetUpstreamStatus ¶
Click to show internal directories.
Click to hide internal directories.