Documentation
¶
Index ¶
- Constants
- type MissingRecord
- type MissingRecordType
- type PostgresBackend
- func (b *PostgresBackend) AddNotification(ctx context.Context, forUser, author uint, recordUri string, recordCid cid.Cid, ...) error
- func (b *PostgresBackend) AddRelevantDid(did string)
- func (b *PostgresBackend) DidFromID(ctx context.Context, uid uint) (string, error)
- func (b *PostgresBackend) DidIsRelevant(did string) bool
- func (b *PostgresBackend) DidToID(ctx context.Context, did string) (uint, error)
- func (b *PostgresBackend) GetOrCreateList(ctx context.Context, uri string) (*List, error)
- func (b *PostgresBackend) GetOrCreateRepo(ctx context.Context, did string) (*Repo, error)
- func (b *PostgresBackend) GetPostByUri(ctx context.Context, uri string, fields string) (*Post, error)
- func (b *PostgresBackend) GetRelevantDids() []string
- func (b *PostgresBackend) GetRepoByID(ctx context.Context, id uint) (*models.Repo, error)
- func (b *PostgresBackend) HandleCreate(ctx context.Context, repo string, rev string, path string, rec *[]byte, ...) error
- func (b *PostgresBackend) HandleCreateBlock(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateChatDeclaration(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateFeedGenerator(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateFollow(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateLike(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateList(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateListblock(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateListitem(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreatePost(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreatePostGate(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateProfile(ctx context.Context, repo *Repo, rkey, rev string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateRepost(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateStarterPack(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleCreateThreadgate(ctx context.Context, repo *Repo, rkey string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) HandleDelete(ctx context.Context, repo string, rev string, path string) error
- func (b *PostgresBackend) HandleDeleteBlock(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteFeedGenerator(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteFollow(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteLike(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteList(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteListblock(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteListitem(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeletePost(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteProfile(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteRepost(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleDeleteThreadgate(ctx context.Context, repo *Repo, rkey string) error
- func (b *PostgresBackend) HandleEvent(ctx context.Context, evt *atproto.SyncSubscribeRepos_Commit) error
- func (b *PostgresBackend) HandleEventJetstream(ctx context.Context, evt *jsmodels.Event) error
- func (b *PostgresBackend) HandleUpdate(ctx context.Context, repo string, rev string, path string, rec *[]byte, ...) error
- func (b *PostgresBackend) HandleUpdateProfile(ctx context.Context, repo *Repo, rkey, rev string, recb []byte, cc cid.Cid) error
- func (b *PostgresBackend) LoadRelevantDids() error
- func (b *PostgresBackend) TrackMissingRecord(identifier string, wait bool)
- type RecordTracker
- type SyncInfo
Constants ¶
View Source
const ( NotifKindReply = "reply" NotifKindLike = "like" NotifKindMention = "mention" NotifKindRepost = "repost" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MissingRecord ¶
type MissingRecord struct {
Type MissingRecordType
Identifier string // DID for profiles, AT-URI for posts/feedgens
Wait bool
// contains filtered or unexported fields
}
type MissingRecordType ¶
type MissingRecordType string
const ( MissingRecordTypeProfile MissingRecordType = "profile" MissingRecordTypePost MissingRecordType = "post" MissingRecordTypeFeedGenerator MissingRecordType = "feedgenerator" MissingRecordTypeUnknown MissingRecordType = "unknown" )
type PostgresBackend ¶
type PostgresBackend struct {
// contains filtered or unexported fields
}
PostgresBackend handles database operations
func NewPostgresBackend ¶
func NewPostgresBackend(mydid string, db *gorm.DB, pgx *pgxpool.Pool, client *xrpc.Client, dir identity.Directory) (*PostgresBackend, error)
NewPostgresBackend creates a new PostgresBackend
func (*PostgresBackend) AddNotification ¶
func (*PostgresBackend) AddRelevantDid ¶
func (b *PostgresBackend) AddRelevantDid(did string)
func (*PostgresBackend) DidIsRelevant ¶
func (b *PostgresBackend) DidIsRelevant(did string) bool
func (*PostgresBackend) GetOrCreateList ¶
func (b *PostgresBackend) GetOrCreateList(ctx context.Context, uri string) (*List, error)
func (*PostgresBackend) GetOrCreateRepo ¶
func (b *PostgresBackend) GetOrCreateRepo(ctx context.Context, did string) (*Repo, error)
func (*PostgresBackend) GetPostByUri ¶
func (*PostgresBackend) GetRelevantDids ¶
func (b *PostgresBackend) GetRelevantDids() []string
func (*PostgresBackend) GetRepoByID ¶
func (*PostgresBackend) HandleCreate ¶
func (*PostgresBackend) HandleCreateBlock ¶
func (*PostgresBackend) HandleCreateChatDeclaration ¶
func (*PostgresBackend) HandleCreateFeedGenerator ¶
func (*PostgresBackend) HandleCreateFollow ¶
func (*PostgresBackend) HandleCreateLike ¶
func (*PostgresBackend) HandleCreateList ¶
func (*PostgresBackend) HandleCreateListblock ¶
func (*PostgresBackend) HandleCreateListitem ¶
func (*PostgresBackend) HandleCreatePost ¶
func (*PostgresBackend) HandleCreatePostGate ¶
func (*PostgresBackend) HandleCreateProfile ¶
func (*PostgresBackend) HandleCreateRepost ¶
func (*PostgresBackend) HandleCreateStarterPack ¶
func (*PostgresBackend) HandleCreateThreadgate ¶
func (*PostgresBackend) HandleDelete ¶
func (*PostgresBackend) HandleDeleteBlock ¶
func (b *PostgresBackend) HandleDeleteBlock(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteFeedGenerator ¶
func (b *PostgresBackend) HandleDeleteFeedGenerator(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteFollow ¶
func (b *PostgresBackend) HandleDeleteFollow(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteLike ¶
func (b *PostgresBackend) HandleDeleteLike(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteList ¶
func (b *PostgresBackend) HandleDeleteList(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteListblock ¶
func (b *PostgresBackend) HandleDeleteListblock(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteListitem ¶
func (b *PostgresBackend) HandleDeleteListitem(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeletePost ¶
func (b *PostgresBackend) HandleDeletePost(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteProfile ¶
func (b *PostgresBackend) HandleDeleteProfile(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteRepost ¶
func (b *PostgresBackend) HandleDeleteRepost(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleDeleteThreadgate ¶
func (b *PostgresBackend) HandleDeleteThreadgate(ctx context.Context, repo *Repo, rkey string) error
func (*PostgresBackend) HandleEvent ¶
func (b *PostgresBackend) HandleEvent(ctx context.Context, evt *atproto.SyncSubscribeRepos_Commit) error
func (*PostgresBackend) HandleEventJetstream ¶
func (*PostgresBackend) HandleUpdate ¶
func (*PostgresBackend) HandleUpdateProfile ¶
func (*PostgresBackend) LoadRelevantDids ¶
func (b *PostgresBackend) LoadRelevantDids() error
func (*PostgresBackend) TrackMissingRecord ¶
func (b *PostgresBackend) TrackMissingRecord(identifier string, wait bool)
TrackMissingRecord implements the RecordTracker interface
type RecordTracker ¶
type RecordTracker interface {
// TrackMissingRecord queues a missing record for fetching
// identifier can be:
// - A DID (e.g., "did:plc:...") for actors/profiles
// - An AT-URI (e.g., "at://did:plc:.../app.bsky.feed.post/...") for posts
// - An AT-URI (e.g., "at://did:plc:.../app.bsky.feed.generator/...") for feed generators
// wait: if true, blocks until the record is fetched
TrackMissingRecord(identifier string, wait bool)
}
RecordTracker is an interface for tracking missing records that need to be fetched
Click to show internal directories.
Click to hide internal directories.