Add unified post storage (#3)
Adds one post creation path for roots and replies, recursive thread loading, body-only updates, root listings, and root-only voting across PostgreSQL and the in-memory store. Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #3.
This commit is contained in:
@@ -37,6 +37,13 @@ type Store interface {
|
||||
GetAnswer(ctx context.Context, questionID string) (*Answer, error)
|
||||
UpsertAnswer(ctx context.Context, a *Answer) error
|
||||
|
||||
CreatePost(ctx context.Context, post *Post) error
|
||||
GetPost(ctx context.Context, id string) (*Post, error)
|
||||
GetPostThread(ctx context.Context, rootID string) (*Post, error)
|
||||
UpdatePost(ctx context.Context, post *Post) error
|
||||
ListRootPosts(ctx context.Context, postDate, viewerID string) ([]Post, error)
|
||||
VotePost(ctx context.Context, userID, postID string, value int) error
|
||||
|
||||
// Vote sets the vote to 1, -1, or 0 (clear) on a visible question.
|
||||
Vote(ctx context.Context, userID, questionID string, value int) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user