Documentation ¶
Index ¶
- func HandleRepoInfo(ctx context.Context, info *comatproto.SyncSubscribeRepos_Info) error
- type BSky
- func (bsky *BSky) DecodeFacets(ctx context.Context, facets []*appbsky.RichtextFacet) ([]string, []string, error)
- func (bsky *BSky) GetCursor(ctx context.Context) string
- func (bsky *BSky) HandleError(ctx context.Context, errf *events.ErrorFrame) error
- func (bsky *BSky) HandleRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error
- func (bsky *BSky) ProcessRepoRecord(ctx context.Context, seq int64, pst appbsky.FeedPost, opPath string, ...) error
- func (bsky *BSky) SetCursor(ctx context.Context, cursor int64) error
- type ImageMeta
- type RepoRecord
- type RepoStreamCtxCallbacks
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleRepoInfo ¶
func HandleRepoInfo(ctx context.Context, info *comatproto.SyncSubscribeRepos_Info) error
Types ¶
type BSky ¶
type BSky struct { IncludeLinks bool Logger *zap.SugaredLogger SeqMux sync.RWMutex LastUpdated time.Time LastSeq int64 // LastSeq is the last sequence number processed RepoRecordQueue chan RepoRecord WorkerCount int Workers []*Worker PostRegistryEnabled bool PostRegistry *search.PostRegistry PLCMirrorRoot string // contains filtered or unexported fields }
BSky is a struct that holds the state of the social graph and the authenticated XRPC client
func NewBSky ¶
func NewBSky( ctx context.Context, includeLinks, postRegistryEnabled bool, dbConnectionString, redisPrefix, plcMirrorRoot string, redisClient *redis.Client, workerCount int, ) (*BSky, error)
NewBSky creates a new BSky struct with an authenticated XRPC client and a social graph, initializing mutexes for cross-routine access
func (*BSky) DecodeFacets ¶
func (bsky *BSky) DecodeFacets( ctx context.Context, facets []*appbsky.RichtextFacet, ) ([]string, []string, error)
DecodeFacets decodes the facets of a richtext record into mentions and links
func (*BSky) HandleError ¶
func (*BSky) HandleRepoCommit ¶
func (bsky *BSky) HandleRepoCommit(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error
HandleRepoCommit is called when a repo commit is received and prints its contents
func (*BSky) ProcessRepoRecord ¶
type RepoRecord ¶
type RepoRecord struct {
// contains filtered or unexported fields
}
RepoRecord holds data needed for processing a RepoRecord
type RepoStreamCtxCallbacks ¶
type RepoStreamCtxCallbacks struct { RepoCommit func(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Commit) error RepoHandle func(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Handle) error RepoInfo func(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Info) error RepoMigrate func(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Migrate) error RepoTombstone func(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Tombstone) error Error func(ctx context.Context, evt *events.ErrorFrame) error }
type Worker ¶
type Worker struct { WorkerID int Logger *zap.SugaredLogger }
Click to show internal directories.
Click to hide internal directories.