store

package
v0.0.57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound indicates that no resource was found during a store call.
	ErrNotFound = fmt.Errorf("not found")
)

Functions

This section is empty.

Types

type CloudSQLConnector added in v0.0.4

type CloudSQLConnector struct {
	Instance string
	Database string
	// TODO: Determine user from the app default service credentials
	Username string
}

type CreateActorOpts added in v0.0.4

type CreateActorOpts struct {
	DID     string
	Comment string
	Status  v1.ActorStatus
	Roles   []string
}

type CreateAuditEventOpts added in v0.0.11

type CreateAuditEventOpts struct {
	ActorDID         string
	SubjectDID       string
	SubjectRecordURI string
	Payload          proto.Message
}

type CreateFollowOpts added in v0.0.4

type CreateFollowOpts struct {
	URI        string
	ActorDID   string
	SubjectDID string
	CreatedAt  time.Time
	IndexedAt  time.Time
}

type CreateLatestActorProfileOpts added in v0.0.14

type CreateLatestActorProfileOpts struct {
	// DID is the DID of the actor to update.
	ActorDID string
	// CommitCID is now used for the repo rev at the commit
	// that set this version of the profile.
	CommitCID   string
	CreatedAt   time.Time
	IndexedAt   time.Time
	DisplayName string
	Description string
	SelfLabels  []string
}

type CreateLikeOpts added in v0.0.4

type CreateLikeOpts struct {
	URI        string
	ActorDID   string
	SubjectURI string
	CreatedAt  time.Time
	IndexedAt  time.Time
}

type CreatePostOpts added in v0.0.4

type CreatePostOpts struct {
	URI        string
	ActorDID   string
	CreatedAt  time.Time
	IndexedAt  time.Time
	Hashtags   []string
	HasMedia   bool
	Raw        *bsky.FeedPost
	SelfLabels []string
}

type DeleteFollowOpts added in v0.0.4

type DeleteFollowOpts struct {
	URI string
}

type DeleteLikeOpts added in v0.0.4

type DeleteLikeOpts struct {
	URI string
}

type DeletePostOpts added in v0.0.4

type DeletePostOpts struct {
	URI string
}

type DirectConnector added in v0.0.4

type DirectConnector struct {
	URI string
}

type ListActorsOpts added in v0.0.4

type ListActorsOpts struct {
	FilterStatus v1.ActorStatus
}

type ListAuditEventsOpts added in v0.0.11

type ListAuditEventsOpts struct {
	FilterSubjectDID    string
	FilterCreatedBefore *time.Time

	// Limit defaults to 100.
	Limit int32
}

type ListPostsForHotFeedCursor added in v0.0.27

type ListPostsForHotFeedCursor struct {
	GenerationSeq int64
	AfterScore    float32
	AfterURI      string
}

type ListPostsForHotFeedOpts added in v0.0.27

type ListPostsForHotFeedOpts struct {
	Alg                string
	Cursor             ListPostsForHotFeedCursor
	Hashtags           []string
	DisallowedHashtags []string
	IsNSFW             tristate.Tristate
	HasMedia           tristate.Tristate
	Limit              int
}

type ListPostsForNewFeedOpts added in v0.0.4

type ListPostsForNewFeedOpts struct {
	CursorTime         time.Time
	Hashtags           []string
	DisallowedHashtags []string
	IsNSFW             tristate.Tristate
	HasMedia           tristate.Tristate
	PinnedDIDs         []string
	Limit              int
}

type ListPostsWithLikesOpts added in v0.0.4

type ListPostsWithLikesOpts struct {
	CursorTime time.Time
	Limit      int
}

type PGXStore added in v0.0.4

type PGXStore struct {
	// contains filtered or unexported fields
}

func ConnectPGXStore added in v0.0.4

func ConnectPGXStore(ctx context.Context, log *zap.Logger, connector PoolConnector) (*PGXStore, error)

func (*PGXStore) Close added in v0.0.4

func (s *PGXStore) Close()

func (*PGXStore) CreateActor added in v0.0.4

func (s *PGXStore) CreateActor(ctx context.Context, opts CreateActorOpts) (out *v1.Actor, err error)

func (*PGXStore) CreateAuditEvent added in v0.0.11

func (s *PGXStore) CreateAuditEvent(ctx context.Context, opts CreateAuditEventOpts) (out *v1.AuditEvent, err error)

func (*PGXStore) CreateFollow added in v0.0.4

func (s *PGXStore) CreateFollow(ctx context.Context, opts CreateFollowOpts) (err error)

func (*PGXStore) CreateLatestActorProfile added in v0.0.14

func (s *PGXStore) CreateLatestActorProfile(ctx context.Context, opts CreateLatestActorProfileOpts) (err error)

func (*PGXStore) CreateLike added in v0.0.4

func (s *PGXStore) CreateLike(ctx context.Context, opts CreateLikeOpts) (err error)

func (*PGXStore) CreatePost added in v0.0.4

func (s *PGXStore) CreatePost(ctx context.Context, opts CreatePostOpts) (err error)

func (*PGXStore) DeleteFollow added in v0.0.4

func (s *PGXStore) DeleteFollow(ctx context.Context, opts DeleteFollowOpts) (err error)

func (*PGXStore) DeleteLike added in v0.0.4

func (s *PGXStore) DeleteLike(ctx context.Context, opts DeleteLikeOpts) (err error)

func (*PGXStore) DeleteOldPostScores added in v0.0.27

func (s *PGXStore) DeleteOldPostScores(ctx context.Context, before time.Time) (int64, error)

func (*PGXStore) DeletePost added in v0.0.4

func (s *PGXStore) DeletePost(ctx context.Context, opts DeletePostOpts) (err error)

func (*PGXStore) GetActorByDID added in v0.0.9

func (s *PGXStore) GetActorByDID(ctx context.Context, did string) (out *v1.Actor, err error)

func (*PGXStore) GetActorProfileHistory added in v0.0.17

func (s *PGXStore) GetActorProfileHistory(ctx context.Context, did string) (out []gen.ActorProfile, err error)

func (*PGXStore) GetFirehoseCommitCursor added in v0.0.21

func (s *PGXStore) GetFirehoseCommitCursor(ctx context.Context) (out int64, err error)

func (*PGXStore) GetLatestActorProfile added in v0.0.17

func (s *PGXStore) GetLatestActorProfile(ctx context.Context, did string) (out gen.ActorProfile, err error)

func (*PGXStore) GetLatestScoreGeneration added in v0.0.27

func (s *PGXStore) GetLatestScoreGeneration(ctx context.Context, alg string) (out int64, err error)

func (*PGXStore) GetPostByURI added in v0.0.15

func (s *PGXStore) GetPostByURI(ctx context.Context, uri string) (out gen.CandidatePost, err error)

func (*PGXStore) HoldBackPendingActor added in v0.0.38

func (s *PGXStore) HoldBackPendingActor(ctx context.Context, did string, duration time.Time) error

func (*PGXStore) ListActors added in v0.0.4

func (s *PGXStore) ListActors(ctx context.Context, opts ListActorsOpts) (out []*v1.Actor, err error)

func (*PGXStore) ListAuditEvents added in v0.0.11

func (s *PGXStore) ListAuditEvents(ctx context.Context, opts ListAuditEventsOpts) (out []*v1.AuditEvent, err error)

func (*PGXStore) ListPostsForNewFeed added in v0.0.4

func (s *PGXStore) ListPostsForNewFeed(ctx context.Context, opts ListPostsForNewFeedOpts) (out []gen.CandidatePost, err error)

func (*PGXStore) ListScoredPosts added in v0.0.27

func (s *PGXStore) ListScoredPosts(ctx context.Context, opts ListPostsForHotFeedOpts) (out []gen.ListScoredPostsRow, err error)

func (*PGXStore) MaterializeClassicPostScores added in v0.0.27

func (s *PGXStore) MaterializeClassicPostScores(ctx context.Context, after time.Time) (int64, error)

func (*PGXStore) SetFirehoseCommitCursor added in v0.0.21

func (s *PGXStore) SetFirehoseCommitCursor(ctx context.Context, cursor int64) (err error)

func (*PGXStore) TX added in v0.0.21

func (s *PGXStore) TX(ctx context.Context) (*PGXTX, error)

func (*PGXStore) UpdateActor added in v0.0.4

func (s *PGXStore) UpdateActor(ctx context.Context, opts UpdateActorOpts) (out *v1.Actor, err error)

type PGXTX added in v0.0.21

type PGXTX struct {
	*PGXStore
	// contains filtered or unexported fields
}

func (*PGXTX) Commit added in v0.0.21

func (s *PGXTX) Commit(ctx context.Context) error

func (*PGXTX) Rollback added in v0.0.21

func (s *PGXTX) Rollback()

Rollback rolls back a transaction if it has not already been committed. This is safe to call when the transaction has been committed, so defer this when creating a transaction.

func (*PGXTX) TX added in v0.0.21

func (s *PGXTX) TX(_ context.Context) (*PGXStore, error)

type PoolConnector added in v0.0.4

type PoolConnector interface {
	// contains filtered or unexported methods
}

type UpdateActorOpts added in v0.0.4

type UpdateActorOpts struct {
	// DID is the DID of the actor to update.
	DID string
	// TODO: These fields should be optional
	UpdateStatus   v1.ActorStatus
	UpdateIsArtist bool
	UpdateComment  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL